|
- <?php
- require_once "Api/ApiBase.php";
- require_once "Lib/Action/ChangePW.php";
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2016/12/1
- * Time: 14:02
- */
- class ChangePassword extends ApiBase
- {
- function changePasswordC(){
- $user_id = $this-> login_user_id;
- $agoPwd = isset($_REQUEST['agoPwd']) ? $_REQUEST['agoPwd'] : ""; // 允许为空
- $nowPwd = isset($_REQUEST['nowPwd']) ? $_REQUEST['nowPwd'] : ""; // 允许为空
- if ($agoPwd ==''||$nowPwd==''){
- $data['code'] = "1";
- $data['info'] = "错误的请求参数";
- return $data;
- }
- $md_agoPwd = md5($agoPwd);
- $md_nowPwd = md5($nowPwd);
- $changePWC = new ChangePWC();
- $data =$changePWC ->changePW($user_id,$md_agoPwd,$md_nowPwd);
- return $data;
- }
- }
- $obj = new ChangePassword();
- $data = $obj ->changePasswordC();
- echo json_encode($data);
|