songxingwei 2 rokov pred
rodič
commit
bd1f061e81
1 zmenil súbory, kde vykonal 2 pridanie a 0 odobranie
  1. 2 0
      app/data/controller/api/auth/Center.php

+ 2 - 0
app/data/controller/api/auth/Center.php

@@ -136,6 +136,8 @@ class Center extends Auth
             'newpassword.require'=>'新密码必须'
         ]);
         if ($data['password']==$data['newpassword']) $this->error('原密码与新密码一样');
+        $pass = DataUser::mk()->where('id',$this->uuid)->value('password');
+        if (md5($data['password'])!=$pass) $this->error('原密码验证错误');
         if (DataUser::mk()->where(['id' => $this->uuid])->update(['password'=>md5($data['newpassword'])]) !== false) {
             $this->success('更新密码成功!', $this->getUser());
         } else {