Explorar o código

Merge branch 'dev_wf' of wufeng/fuse into version1.5

wufeng %!s(int64=2) %!d(string=hai) anos
pai
achega
9193ec624d

+ 0 - 1
app/admin/config/validate_rules.php

@@ -129,7 +129,6 @@ return [
     //更改密码
     'adminChangePasswod' => [
         'id' => 'require|number|gt:0',
-        'old_password|旧密码' => 'require|max:255',
         'new_password|新密码' => 'require|min:6|max:255',
     ],
 

+ 1 - 8
app/admin/controller/Admin.php

@@ -72,7 +72,7 @@ class Admin extends BaseController
     //更改密码
     public function changePasswod()
     {
-        $param = $this->request->only(['id', 'old_password', 'new_password'], 'post');
+        $param = $this->request->only(['id', 'new_password'], 'post');
 
         $val = Validate::rule(Config::get('validate_rules.adminChangePasswod'));
 
@@ -81,13 +81,6 @@ class Admin extends BaseController
         return AdminLogic::changePasswod($param);
     }
 
-    //重置密码(慎用)
-    public function resetPasswod()
-    {
-        $id = $this->request->post('id/d', 0);
-
-        return AdminLogic::resetPasswod($id);
-    }
 
 
 }

+ 0 - 24
app/admin/logic/AdminLogic.php

@@ -125,7 +125,6 @@ class AdminLogic extends BaseLogic
             ->findOrEmpty();
 
         if ($rs->isEmpty()) throw new ValidateException('该运营账号不存在');
-        if (getPassword($data['old_password'], $rs->salt) != $rs->password) throw new ValidateException('旧密码错误');
 
         $salt = randomkeys(6);
         $password = getPassword($data['new_password'], $salt);
@@ -142,28 +141,5 @@ class AdminLogic extends BaseLogic
         return $rs ? json_show(CommonModel::$success, '更改密码成功') : json_show(CommonModel::$error_param, '更改密码失败');
     }
 
-    //重置密码(慎用)
-    public static function resetPasswod(int $id = 0): Json
-    {
-        $rs = AdminModel::where(['id' => $id, 'is_del' => CommonModel::$del_normal])
-            ->field('id')
-            ->findOrEmpty()
-            ->isEmpty();
-
-        if ($rs) throw new ValidateException('该运营账号不存在');
-
-        $salt = randomkeys(6);
-
-        $da = [
-            'salt' => $salt,
-            'password' => getPassword(Config::get('common.default_password'), $salt),
-            'updatetime' => date('Y-m-d H:i:s'),
-        ];
-
-        $rs = AdminModel::where(['id' => $id, 'is_del' => CommonModel::$del_normal])
-            ->save($da);
-
-        return $rs ? json_show(CommonModel::$success, '重置密码成功') : json_show(CommonModel::$error_param, '重置密码失败');
-    }
 
 }

+ 0 - 1
app/admin/route/app.php

@@ -43,7 +43,6 @@ Route::rule('adminEdit', 'admin/Admin/edit');//编辑运营账号
 Route::rule('adminDelete', 'admin/Admin/delete');//删除运营账号
 Route::rule('adminStatus', 'admin/Admin/status');//启禁用运营账号
 Route::rule('adminChangePasswod', 'admin/Admin/changePasswod');//更改密码
-Route::rule('adminResetPasswod', 'admin/Admin/resetPasswod');//重置密码(慎用)
 
 
 //【视频】