|
@@ -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, '重置密码失败');
|
|
|
- }
|
|
|
|
|
|
}
|