From dc16d105ba23d26d3ad9e52a1a937320b4e7ee7b Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 25 Nov 2019 09:55:41 +0800 Subject: [PATCH] Merge branch 'v6' of https://github.com/zoujingli/ThinkAdmin into v6 --- app/admin/controller/Index.php | 16 ++++++---------- app/admin/view/user/pass.html | 4 ++-- vendor/services.php | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 0807085ba..ee20b0af4 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -92,16 +92,12 @@ class Index extends Controller $this->verify = true; $this->_form('SystemUser', 'admin@user/pass', 'id', [], ['id' => $id]); } else { - $data = [ - 'password' => $this->app->request->post('password'), - 'repassword' => $this->app->request->post('repassword'), - 'oldpassword' => $this->app->request->post('oldpassword'), - ]; - if (empty($data['password'])) $this->error('登录密码不能为空!'); - if (empty($data['oldpassword'])) $this->error('旧密码不能为空!'); - if ($data['repassword'] !== $data['password']) { - $this->error('重复密码与登录密码不匹配,请重新输入!'); - } + $data = $this->_vali([ + 'password.require' => '登录密码不能为空!', + 'repassword.require' => '重复密码不能为空!', + 'oldpassword.require' => '旧密码不能为空!', + 'password.confirm:repassword' => '验证密码与新密码不匹配!', + ]); $user = $this->app->db->name('SystemUser')->where(['id' => $id])->find(); if (md5($data['oldpassword']) !== $user['password']) { $this->error('旧密码验证失败,请重新输入!'); diff --git a/app/admin/view/user/pass.html b/app/admin/view/user/pass.html index edd470210..a37bf9073 100644 --- a/app/admin/view/user/pass.html +++ b/app/admin/view/user/pass.html @@ -37,9 +37,9 @@

密码必需包含大小写字母、数字、符号的任意两者组合。

diff --git a/vendor/services.php b/vendor/services.php index dce2fe5b0..3771ce7a3 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service',