You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ChangePassword.php 933 B

3 years ago
123456789101112131415161718192021222324252627282930
  1. <?php
  2. require_once "Api/ApiBase.php";
  3. require_once "Lib/Action/ChangePW.php";
  4. /**
  5. * Created by PhpStorm.
  6. * User: Administrator
  7. * Date: 2016/12/1
  8. * Time: 14:02
  9. */
  10. class ChangePassword extends ApiBase
  11. {
  12. function changePasswordC(){
  13. $user_id = $this-> login_user_id;
  14. $agoPwd = isset($_REQUEST['agoPwd']) ? $_REQUEST['agoPwd'] : ""; // 允许为空
  15. $nowPwd = isset($_REQUEST['nowPwd']) ? $_REQUEST['nowPwd'] : ""; // 允许为空
  16. if ($agoPwd ==''||$nowPwd==''){
  17. $data['code'] = "1";
  18. $data['info'] = "错误的请求参数";
  19. return $data;
  20. }
  21. $md_agoPwd = md5($agoPwd);
  22. $md_nowPwd = md5($nowPwd);
  23. $changePWC = new ChangePWC();
  24. $data =$changePWC ->changePW($user_id,$md_agoPwd,$md_nowPwd);
  25. return $data;
  26. }
  27. }
  28. $obj = new ChangePassword();
  29. $data = $obj ->changePasswordC();
  30. echo json_encode($data);