增加密码过期功能

This commit is contained in:
瓜哥 committed 2022-01-02 22:27:07 +08:00
1 parent ec1014f8b3
commit a6cd67b1f2
12 files changed
+103 -6

No files matched your search

+7 -1
View File
@@ -110,6 +110,7 @@ class Index extends AdminBase
,'zhuanye'
,'worktime'
,'tuixiu'
,'guoqi' => \app\facade\Tools::mima_guoqi()
,'beizhu'
], 'POST');
@@ -274,8 +275,13 @@ class Index extends AdminBase
$md5 = new APR1_MD5();
$password = $md5->hash('123456');
$data = [
'password' => $password
,'guoqi' => \app\facade\Tools::mima_guoqi()
];
// 查询用户信息
$data = AD::where('id', $id)->update(['password' => $password]);
$data = AD::where('id', $id)->update($data);
// 根据更新结果设置返回提示信息
$data ? $data = ['msg' => '密码已经重置为:<br>123456', 'val' => 1]
: $data = ['msg' => '数据处理错误', 'val' => 0];
+4 -1
View File
@@ -34,6 +34,7 @@ class Admin extends BaseModel
,'lasttime' => 'int'
,'thistime' => 'int'
,'status' => 'tinyint'
,'guoqi' => 'int'
,'create_time' => 'int'
,'update_time' => 'int'
,'delete_time' => 'int'
@@ -189,8 +190,9 @@ class Admin extends BaseModel
// 整理表格数据
array_splice($arr, 0, 4); # 删除标题行
// 获取帐号禁用时间
$jinyong = \app\facade\Tools::mima_guoqi();
// 组合需要保存的数据
$i = 0;
$teacherlist = array();
$validate = new \app\admin\validate\Admin;
$err = ['导入失败原因如下:'];
@@ -224,6 +226,7 @@ class Admin extends BaseModel
$teacherInfo[$i]['beizhu'] = $value[12];
$teacherInfo[$i]['lasttime'] = time();
$teacherInfo[$i]['thistime'] = time();
$teacherInfo[$i]['guoqi'] = $jinyong;
// 验证数据
$result = $validate->scene('admincreateall')->check($teacherInfo[$i]);
$msg = $validate->getError();
+7 -1
View File
@@ -187,6 +187,7 @@ class Index extends AdminBase
,'quanpin'
,'shoupin'
,'xuehao'
,'guoqi' => \app\facade\Tools::mima_guoqi()
], 'POST');
// 验证表单数据
@@ -647,8 +648,13 @@ class Index extends AdminBase
$md5 = new \WhiteHat101\Crypt\APR1_MD5;
$password = $md5->hash('123456');
$data = [
'password' => $password
,'guoqi' => \app\facade\Tools::mima_guoqi()
];
// 查询用户信息
$data = STU::where('id', $id)->update(['password' => $password]);
$data = STU::where('id', $id)->update($data);
// 根据更新结果设置返回提示信息
$data ? $data = ['msg' => '密码已经重置为:<br>123456', 'val' => 1]
: $data = ['msg' => '数据处理错误', 'val' => 0];
Loaded 3 of 12 files, more files were not shown because too many files have changed in this diff. Show more