|
|
@@ -325,4 +325,21 @@ class AdminController extends BaseController
|
|
|
util::complete();
|
|
|
}
|
|
|
|
|
|
+ //修改密码 shish 20220106
|
|
|
+ public function actionModifyPassword()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $password = $get['password'] ?? '';
|
|
|
+ if (empty($password)) {
|
|
|
+ util::fail('请填写密码');
|
|
|
+ }
|
|
|
+ if (ctype_alnum($password)) {
|
|
|
+ util::fail('密码必须是字母、数字和符号的组合');
|
|
|
+ }
|
|
|
+ $adminId = $this->adminId;
|
|
|
+ $password = password_hash($password, PASSWORD_BCRYPT);
|
|
|
+ AdminClass::updateById($adminId, ['password' => $password]);
|
|
|
+ util::complete('操作成功');
|
|
|
+ }
|
|
|
+
|
|
|
}
|