mirror of https://gitee.com/karson/fastadmin.git
parent
f28089b1f0
commit
cd17735bef
|
|
@ -1,5 +1,5 @@
|
||||||
name = {%name%}
|
name = {%name%}
|
||||||
title = 插件名称({%name%})
|
title = 插件名称{%name%}
|
||||||
intro = FastAdmin插件
|
intro = FastAdmin插件
|
||||||
author = yourname
|
author = yourname
|
||||||
website = http://www.fastadmin.net
|
website = http://www.fastadmin.net
|
||||||
|
|
|
||||||
|
|
@ -28,5 +28,6 @@ return [
|
||||||
'Createtime' => '创建时间',
|
'Createtime' => '创建时间',
|
||||||
'Updatetime' => '更新时间',
|
'Updatetime' => '更新时间',
|
||||||
'Token' => 'Token',
|
'Token' => 'Token',
|
||||||
'Status' => '状态'
|
'Status' => '状态',
|
||||||
|
'Leave password blank if dont want to change' => '不修改密码请留空',
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,14 @@ class User extends Model
|
||||||
self::beforeUpdate(function ($row) {
|
self::beforeUpdate(function ($row) {
|
||||||
$changed = $row->getChangedData();
|
$changed = $row->getChangedData();
|
||||||
//如果有修改密码
|
//如果有修改密码
|
||||||
if (isset($changed['password']))
|
if (isset($changed['password'])) {
|
||||||
{
|
if ($changed['password']) {
|
||||||
$salt = \fast\Random::alnum();
|
$salt = \fast\Random::alnum();
|
||||||
$row->password = \app\common\library\Auth::instance()->getEncryptPassword($changed['password'], $salt);
|
$row->password = \app\common\library\Auth::instance()->getEncryptPassword($changed['password'], $salt);
|
||||||
$row->salt = $salt;
|
$row->salt = $salt;
|
||||||
|
} else {
|
||||||
|
unset($row->password);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ return [
|
||||||
'Reset password' => '修改密码',
|
'Reset password' => '修改密码',
|
||||||
'Reset password by email' => '通过邮箱',
|
'Reset password by email' => '通过邮箱',
|
||||||
'Reset password by mobile' => '通过手机重置',
|
'Reset password by mobile' => '通过手机重置',
|
||||||
|
'Reset password successful' => '修改密码成功',
|
||||||
'Account is locked' => '账户已经被锁定',
|
'Account is locked' => '账户已经被锁定',
|
||||||
'Password is incorrect' => '密码不正确',
|
'Password is incorrect' => '密码不正确',
|
||||||
'Account is incorrect' => '账户不正确',
|
'Account is incorrect' => '账户不正确',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue