diff --git a/application/admin/command/Addon/stubs/info.stub b/application/admin/command/Addon/stubs/info.stub index d01e0cb..5df7704 100644 --- a/application/admin/command/Addon/stubs/info.stub +++ b/application/admin/command/Addon/stubs/info.stub @@ -1,5 +1,5 @@ name = {%name%} -title = 插件名称({%name%}) +title = 插件名称{%name%} intro = FastAdmin插件 author = yourname website = http://www.fastadmin.net diff --git a/application/admin/lang/zh-cn/user/user.php b/application/admin/lang/zh-cn/user/user.php index e825f26..13f096d 100644 --- a/application/admin/lang/zh-cn/user/user.php +++ b/application/admin/lang/zh-cn/user/user.php @@ -28,5 +28,6 @@ return [ 'Createtime' => '创建时间', 'Updatetime' => '更新时间', 'Token' => 'Token', - 'Status' => '状态' + 'Status' => '状态', + 'Leave password blank if dont want to change' => '不修改密码请留空', ]; diff --git a/application/admin/model/User.php b/application/admin/model/User.php index 42ebda9..a861235 100644 --- a/application/admin/model/User.php +++ b/application/admin/model/User.php @@ -26,11 +26,14 @@ class User extends Model self::beforeUpdate(function ($row) { $changed = $row->getChangedData(); //如果有修改密码 - if (isset($changed['password'])) - { - $salt = \fast\Random::alnum(); - $row->password = \app\common\library\Auth::instance()->getEncryptPassword($changed['password'], $salt); - $row->salt = $salt; + if (isset($changed['password'])) { + if ($changed['password']) { + $salt = \fast\Random::alnum(); + $row->password = \app\common\library\Auth::instance()->getEncryptPassword($changed['password'], $salt); + $row->salt = $salt; + } else { + unset($row->password); + } } }); } diff --git a/application/index/lang/zh-cn/user.php b/application/index/lang/zh-cn/user.php index 12a512e..0f1fcf0 100755 --- a/application/index/lang/zh-cn/user.php +++ b/application/index/lang/zh-cn/user.php @@ -36,6 +36,7 @@ return [ 'Reset password' => '修改密码', 'Reset password by email' => '通过邮箱', 'Reset password by mobile' => '通过手机重置', + 'Reset password successful' => '修改密码成功', 'Account is locked' => '账户已经被锁定', 'Password is incorrect' => '密码不正确', 'Account is incorrect' => '账户不正确',