This commit is contained in:
Anyon 2019-11-25 09:55:41 +08:00
parent 967644b339
commit dc16d105ba
3 changed files with 9 additions and 13 deletions

View File

@ -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('旧密码验证失败,请重新输入!');

View File

@ -37,9 +37,9 @@
<div class="layui-form-item">
<label class="relative block">
<span class="color-green font-w7">重复登录密码</span>
<span class="color-green font-w7">验证登录密码</span>
<span class="color-desc margin-left-5">Retype Password</span>
<input type="password" name="repassword" maxlength="32" pattern="^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,32}$" required placeholder="请输入重复登录密码" class="layui-input">
<input type="password" name="repassword" maxlength="32" pattern="^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,32}$" required placeholder="请输入验证登录密码" class="layui-input">
</label>
<p class="color-desc">密码必需包含大小写字母、数字、符号的任意两者组合。</p>
</div>

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2019-11-25 09:53:56
// This file is automatically generated at:2019-11-25 09:55:30
declare (strict_types = 1);
return array (
0 => 'think\\app\\Service',