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/composer.lock b/composer.lock
index 5d437065b..bddd9d315 100644
--- a/composer.lock
+++ b/composer.lock
@@ -783,12 +783,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
- "reference": "a01d99bd039989a587fdc0c9d38e300b86a71045"
+ "reference": "d59b40f099926275e5ecec372624ab7212c27bc0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a01d99bd039989a587fdc0c9d38e300b86a71045",
- "reference": "a01d99bd039989a587fdc0c9d38e300b86a71045",
+ "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d59b40f099926275e5ecec372624ab7212c27bc0",
+ "reference": "d59b40f099926275e5ecec372624ab7212c27bc0",
"shasum": "",
"mirrors": [
{
@@ -832,7 +832,7 @@
],
"description": "ThinkPHP v6.0 Development Library",
"homepage": "http://framework.thinkadmin.top",
- "time": "2019-11-23T10:28:22+00:00"
+ "time": "2019-11-23T12:12:24+00:00"
}
],
"packages-dev": [],
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index f4f01cae5..afa85abd7 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -805,12 +805,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
- "reference": "a01d99bd039989a587fdc0c9d38e300b86a71045"
+ "reference": "d59b40f099926275e5ecec372624ab7212c27bc0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a01d99bd039989a587fdc0c9d38e300b86a71045",
- "reference": "a01d99bd039989a587fdc0c9d38e300b86a71045",
+ "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d59b40f099926275e5ecec372624ab7212c27bc0",
+ "reference": "d59b40f099926275e5ecec372624ab7212c27bc0",
"shasum": "",
"mirrors": [
{
@@ -826,7 +826,7 @@
"ext-json": "*",
"topthink/framework": "^6.0"
},
- "time": "2019-11-23T10:28:22+00:00",
+ "time": "2019-11-23T12:12:24+00:00",
"type": "library",
"extra": {
"think": {
diff --git a/vendor/services.php b/vendor/services.php
index bc4b58363..97ed76e16 100644
--- a/vendor/services.php
+++ b/vendor/services.php
@@ -1,5 +1,5 @@
'think\\app\\Service',
diff --git a/vendor/zoujingli/think-library/src/service/CaptchaService.php b/vendor/zoujingli/think-library/src/service/CaptchaService.php
index 8999a25a6..7bde88ace 100644
--- a/vendor/zoujingli/think-library/src/service/CaptchaService.php
+++ b/vendor/zoujingli/think-library/src/service/CaptchaService.php
@@ -146,7 +146,11 @@ class CaptchaService extends Service
$_x = $this->width / $this->codelen;
for ($i = 0; $i < $this->codelen; $i++) {
$this->fontcolor = imagecolorallocate($this->img, mt_rand(0, 156), mt_rand(0, 156), mt_rand(0, 156));
- imagettftext($this->img, $this->fontsize, mt_rand(-30, 30), $_x * $i + mt_rand(1, 5), $this->height / 1.4, $this->fontcolor, $this->font, $this->code[$i]);
+ if (function_exists('imagettftext')) {
+ imagettftext($this->img, $this->fontsize, mt_rand(-30, 30), $_x * $i + mt_rand(1, 5), $this->height / 1.4, $this->fontcolor, $this->font, $this->code[$i]);
+ } else {
+ imagestring($this->img, 15, $_x * $i + mt_rand(10, 15), mt_rand(10, 30), $this->code[$i], $this->fontcolor);
+ }
}
ob_start();
imagepng($this->img);