diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index cb287e81e..6b5af9bae 100644 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -69,7 +69,7 @@ class Config extends Controller } foreach ($this->request->post() as $name => $value) sysconf($name, $value); sysoplog('系统配置管理', "修改系统参数成功"); - $this->success('修改系统参数成功!', sysuri("{$xpath}/index/index") . '#' . url("{$xpath}/config/index")); + $this->success('修改系统参数成功!', 'javascript:$.form.reload(true)'); } } diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 94b3eea97..263436c7d 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -99,7 +99,7 @@ class Index extends Controller } if ($this->app->request->isGet()) { $this->verify = true; - $this->_form('SystemUser', 'admin@user/pass', 'id', [], ['id' => $id]); + SystemUser::mForm('admin@user/pass', 'id', [], ['id' => $id]); } else { $data = $this->_vali([ 'password.require' => '登录密码不能为空!', diff --git a/app/admin/controller/Login.php b/app/admin/controller/Login.php index 9b607a16e..be77a74e3 100644 --- a/app/admin/controller/Login.php +++ b/app/admin/controller/Login.php @@ -46,7 +46,7 @@ class Login extends Controller $this->title = '系统登录'; $this->captchaType = 'LoginCaptcha'; $this->captchaToken = CodeExtend::uniqidDate(18); - $this->devmode = SystemService::instance()->checkRunMode(); + $this->developmentMode = SystemService::instance()->checkRunMode(); // 刷新当前后台域名 $host = "{$this->request->scheme()}://{$this->request->host()}"; if ($host !== sysconf('base.site_host')) sysconf('base.site_host', $host); diff --git a/app/admin/controller/Menu.php b/app/admin/controller/Menu.php index 41d19fcc8..e63508557 100644 --- a/app/admin/controller/Menu.php +++ b/app/admin/controller/Menu.php @@ -65,7 +65,7 @@ class Menu extends Controller // 菜单数据树数据变平化 $data = DataExtend::arr2table($data); foreach ($data as &$vo) { - if ($vo['url'] !== '#' && !preg_match('#^https?://#', $vo['url'])) { + if ($vo['url'] !== '#' && !preg_match('/^(https?:)?(\/\/|\\\\)/i', $vo['url'])) { $vo['url'] = trim(url($vo['url']) . ($vo['params'] ? "?{$vo['params']}" : ''), '\\/'); } $vo['ids'] = join(',', DataExtend::getArrSubIds($data, $vo['id'])); diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index 56638d319..93dffa465 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -49,11 +49,6 @@ class User extends Controller $this->bases = SystemBase::mk()->items('身份权限'); }, function (QueryHelper $query) { - // 关联用户身份资料 - $query->with(['userinfo' => function (Relation $relation) { - $relation->field('code,name,content'); - }]); - // 加载对应数据列表 if ($this->type === 'index') { $query->where(['is_deleted' => 0, 'status' => 1]); @@ -61,6 +56,11 @@ class User extends Controller $query->where(['is_deleted' => 0, 'status' => 0]); } + // 关联用户身份资料 + $query->with(['userinfo' => function (Relation $relation) { + $relation->field('code,name,content'); + }]); + // 数据列表搜索过滤 $query->equal('status,usertype')->dateBetween('login_at,create_at'); $query->like('username,nickname,contact_phone#phone,contact_mail#mail'); diff --git a/app/admin/controller/api/Runtime.php b/app/admin/controller/api/Runtime.php index 83baa7230..6215b415f 100644 --- a/app/admin/controller/api/Runtime.php +++ b/app/admin/controller/api/Runtime.php @@ -97,14 +97,14 @@ class Runtime extends Controller public function config() { if (AdminService::instance()->isSuper()) try { - $this->app->db->transaction(function () { - [$tmpdata, $newdata] = [[], []]; - foreach (SystemConfig::mk()->order('type,name asc')->cursor() as $item) { - $tmpdata[$item['type']][$item['name']] = $item['value']; - } - foreach ($tmpdata as $type => $items) foreach ($items as $name => $value) { - $newdata[] = ['type' => $type, 'name' => $name, 'value' => $value]; - } + [$tmpdata, $newdata] = [[], []]; + foreach (SystemConfig::mk()->order('type,name asc')->cursor() as $item) { + $tmpdata[$item['type']][$item['name']] = $item['value']; + } + foreach ($tmpdata as $type => $items) foreach ($items as $name => $value) { + $newdata[] = ['type' => $type, 'name' => $name, 'value' => $value]; + } + $this->app->db->transaction(function () use ($newdata) { SystemConfig::mQuery()->empty()->insertAll($newdata); }); $this->app->cache->delete('SystemConfig'); diff --git a/app/admin/controller/api/Upload.php b/app/admin/controller/api/Upload.php index 4ec8ec647..dc885d870 100644 --- a/app/admin/controller/api/Upload.php +++ b/app/admin/controller/api/Upload.php @@ -186,7 +186,7 @@ class Upload extends Controller /** * 获取本地文件对象 - * @return UploadedFile + * @return UploadedFile|void */ private function getFile(): UploadedFile { diff --git a/app/admin/view/login/index.html b/app/admin/view/login/index.html index 97db67a44..dce064ac6 100644 --- a/app/admin/view/login/index.html +++ b/app/admin/view/login/index.html @@ -4,7 +4,7 @@