|
@@ -68,7 +68,7 @@ class UserCenter extends Base
|
|
|
*/
|
|
|
public function getUserInfo()
|
|
|
{
|
|
|
- $field = 'id,phone,password,name,level_id,headimg,openid,true_name,sex,invite_code,birthday,province_name,city_name,counties_name,bind_wechat,id_card,id_card,card_front,card_back,auth_at';
|
|
|
+ $field = 'id,phone,password,name,level_id,pay_password,headimg,openid,true_name,sex,invite_code,birthday,province_name,city_name,counties_name,bind_wechat,id_card,id_card,card_front,card_back,auth_at';
|
|
|
$user_info = User::with('wallet')->field($field)->where('id',$this->user_id)->find()->toArray();
|
|
|
$user_info['level_name'] = UserLevel::where('id',$user_info['level_id'])->value('name');
|
|
|
$user_info['fans'] = User::where('pid',$user_info['id'])->count();
|
|
@@ -188,8 +188,8 @@ class UserCenter extends Base
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @title 更换或设置密码
|
|
|
- * @desc 更换或设置密码
|
|
|
+ * @title 更换或设置登录密码
|
|
|
+ * @desc 更换或设置登录密码
|
|
|
* @author qc
|
|
|
* @url /api/User_center/modifyPassword
|
|
|
* @method POST
|
|
@@ -211,12 +211,43 @@ class UserCenter extends Base
|
|
|
if($user_info['phone'] != $phone) $this->error('与绑定手机号不一致');
|
|
|
$check_code = $this->checkPhoneCode($phone,$code);
|
|
|
if(!$check_code) $this->error('验证码错误');
|
|
|
- $encryption_password = encryption_password($password);
|
|
|
+ $encryption_password = password_hash($password);
|
|
|
Db::name('store_member')->where('id',$uid)->update(['password'=>$password,'encryption_password'=>$encryption_password]);
|
|
|
$this->updatePhoneCode($check_code);
|
|
|
$this->success('更换成功');
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @title 更换或设置提现密码
|
|
|
+ * @desc 更换或设置提现密码
|
|
|
+ * @author qc
|
|
|
+ * @url /api/User_center/setPayPassword
|
|
|
+ * @method POST
|
|
|
+ * @header name:Authorization require:1 desc:Token
|
|
|
+ * @param name:phone type:int require:1 default:-- desc:手机号
|
|
|
+ * @param name:code type:int require:1 default:-- desc:手机号验证码
|
|
|
+ * @param name:pay_password type:string default:-- desc:密码
|
|
|
+ */
|
|
|
+ public function setPayPassword()
|
|
|
+ {
|
|
|
+ $uid = $this->user_id;
|
|
|
+ $phone = input('post.phone');
|
|
|
+ $code = input('post.code');
|
|
|
+ $pay_password = input('post.pay_password');
|
|
|
+ if(empty($phone) || empty($code) || empty($password) ) $this->error('参数错误');
|
|
|
+ $field = 'id,phone';
|
|
|
+ $user_info = Db::name('store_member')->field($field)->where('id',$this->user_id)->find();
|
|
|
+ if(!$user_info['phone']) $this->error('请先绑定手机号');
|
|
|
+ if($user_info['phone'] != $phone) $this->error('与绑定手机号不一致');
|
|
|
+ $check_code = $this->checkPhoneCode($phone,$code);
|
|
|
+ if(!$check_code) $this->error('验证码错误');;
|
|
|
+ Db::name('store_member')->where('id',$uid)->update(['pay_password'=>password_hash($pay_password)]);
|
|
|
+ $this->updatePhoneCode($check_code);
|
|
|
+ $this->success('更换成功');
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* @title 实名认证
|
|
|
* @desc 实名认证
|
|
@@ -320,6 +351,9 @@ class UserCenter extends Base
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* @title 更改或绑定银行卡
|
|
|
* @desc 更改或绑定银行卡
|