|
|
@@ -711,9 +711,10 @@ class MemberService extends BaseService
|
|
|
$email = isset($params['email']) ? $params['email'] : '';
|
|
|
$password = isset($params['password']) ? $params['password'] : '';
|
|
|
$payPassword = isset($params['pay_password']) ? $params['pay_password'] : '';
|
|
|
+ $scene = isset($params['scene'])? trim($params['scene']) : '';
|
|
|
|
|
|
// 用户验证
|
|
|
- $info = $this->model->where(['id' => $userId, 'mark' => 1])->select(['id', 'status'])->first();
|
|
|
+ $info = $this->model->where(['id' => $userId, 'mark' => 1])->select(['id','pay_password', 'status'])->first();
|
|
|
if (!$info) {
|
|
|
$this->error = 2001;
|
|
|
return false;
|
|
|
@@ -727,11 +728,17 @@ class MemberService extends BaseService
|
|
|
|
|
|
// 密码校验
|
|
|
$data = ['update_time' => time()];
|
|
|
- if (isset($params['password']) && $password) {
|
|
|
- $password = get_password($password);
|
|
|
- $data['password'] = $password;
|
|
|
- if ($password != $info['password']) {
|
|
|
- $this->error = 2002;
|
|
|
+
|
|
|
+ // 验证交易密码
|
|
|
+ if(isset($params['pay_password']) && $scene != 'trade'){
|
|
|
+ $userPayPassword = isset($info['pay_password'])? $info['pay_password'] : '';
|
|
|
+ if(empty($userPayPassword)){
|
|
|
+ $this->error = 1040;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if($userPayPassword != get_password($payPassword)){
|
|
|
+ $this->error = 2038;
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
@@ -753,7 +760,6 @@ class MemberService extends BaseService
|
|
|
|
|
|
// 邮箱验证码
|
|
|
$code = isset($params['code'])? trim($params['code']) : '';
|
|
|
- $scene = isset($params['scene'])? trim($params['scene']) : '';
|
|
|
$checkEmail = $scene == 'modify_email'? $newEmail : $email;
|
|
|
if (!EmailService::make()->check($checkEmail, $code, $scene)) {
|
|
|
$this->error = EmailService::make()->getError();
|