修改系统模块

This commit is contained in:
邹景立 2021-08-28 15:25:38 +08:00
parent 444aa82bad
commit 4bfb7c16c8
6 changed files with 11 additions and 11 deletions

View File

@ -45,7 +45,7 @@ class Base extends Controller
{
$this->_query(SystemBase::class)->layTable(function () {
$this->title = '数据字典管理';
$this->types = (new SystemBase)->types();
$this->types = SystemBase::mk()->types();
$this->type = input('get.type') ?: ($this->types[0] ?? '-');
}, function (QueryHelper $query) {
$query->where(['deleted' => 0])->equal('type');
@ -84,7 +84,7 @@ class Base extends Controller
protected function _form_filter(array &$data)
{
if ($this->request->isGet()) {
$this->types = (new SystemBase)->types();
$this->types = SystemBase::mk()->types();
$this->types[] = '--- 新增类型 ---';
$this->type = input('get.type') ?: ($this->types[0] ?? '-');
} else {

View File

@ -107,7 +107,7 @@ class Index extends Controller
'oldpassword.require' => '旧的密码不能为空!',
'password.confirm:repassword' => '两次输入的密码不一致!',
]);
$user = (new SystemUser)->find($id);
$user = SystemUser::mk()->find($id);
if (empty($user)) $this->error('用户不存在!');
if (md5($data['oldpassword']) !== $user['password']) {
$this->error('旧密码验证失败,请重新输入!');

View File

@ -121,7 +121,7 @@ class Menu extends Controller
}
}
/* 列出可选上级菜单 */
$menus = (new SystemMenu)->order('sort desc,id asc')->column('id,pid,icon,url,node,title,params', 'id');
$menus = SystemMenu::mk()->order('sort desc,id asc')->column('id,pid,icon,url,node,title,params', 'id');
$this->menus = DataExtend::arr2table(array_merge($menus, [['id' => '0', 'pid' => '-1', 'url' => '#', 'title' => '顶部菜单']]));
if (isset($vo['id'])) foreach ($this->menus as $menu) if ($menu['id'] === $vo['id']) $vo = $menu;
foreach ($this->menus as $key => $menu) if ($menu['spt'] >= 3 || $menu['url'] !== '#') unset($this->menus[$key]);

View File

@ -57,7 +57,7 @@ class User extends Controller
$this->type = input('type', 'index');
$this->_query(SystemUser::class)->layTable(function () {
$this->title = '系统用户管理';
$this->bases = (new SystemBase)->items('身份权限');
$this->bases = SystemBase::mk()->items('身份权限');
}, function (QueryHelper $query) {
// 加载对应数据列表
if ($this->type === 'index') {
@ -77,7 +77,7 @@ class User extends Controller
*/
protected function _page_filter(array &$data)
{
(new SystemBase)->items('身份权限', $data, 'usertype', 'userinfo');
SystemBase::mk()->items('身份权限', $data, 'usertype', 'userinfo');
}
/**
@ -124,7 +124,7 @@ class User extends Controller
'repassword.require' => '重复密码不能为空!',
'repassword.confirm:password' => '两次输入的密码不一致!',
]);
$user = (new SystemUser)->find($data['id']);
$user = SystemUser::mk()->find($data['id']);
if (!empty($user) && $user->save(['password' => md5($data['password'])])) {
sysoplog('系统用户管理', "修改用户[{$data['id']}]密码成功");
$this->success('密码修改成功,请使用新密码登录!', '');
@ -154,7 +154,7 @@ class User extends Controller
$this->error('登录账号不能为空!');
}
$map = ['username' => $data['username'], 'is_deleted' => 0];
if ((new SystemUser)->where($map)->count() > 0) {
if (SystemUser::mk()->where($map)->count() > 0) {
$this->error("账号已经存在,请使用其它账号!");
}
// 新添加的用户密码与账号相同
@ -162,7 +162,7 @@ class User extends Controller
}
} else {
// 用户身份数据
$this->bases = (new SystemBase)->items('身份权限');
$this->bases = SystemBase::mk()->items('身份权限');
// 权限绑定处理
$data['authorize'] = str2arr($data['authorize'] ?? '');
// 用户权限管理

View File

@ -16,7 +16,7 @@
namespace app\admin\model;
use think\Model;
use think\admin\Model;
/**
* 数据字典数据模型

View File

@ -16,7 +16,7 @@
namespace app\admin\model;
use think\Model;
use think\admin\Model;
/**
* 系统任务数据模型