From de64561b470d3e1ea6d333bce2b77c62352dfa88 Mon Sep 17 00:00:00 2001 From: walkor Date: Thu, 8 Dec 2022 20:24:57 +0800 Subject: [PATCH] save --- .../admin/app/controller/ConfigController.php | 4 +-- .../admin/app/middleware/AccessControl.php | 2 +- src/plugin/admin/app/view/account/login.html | 12 +++++++-- src/plugin/admin/app/view/index/install.html | 14 +++++++++-- .../admin/public/admin/js/permission.js | 4 ++- .../public/component/pear/module/theme.js | 2 +- .../admin/public/config/pear.config.json | 2 +- src/plugin/admin/webman-admin.sql | 25 ++++++------------- 8 files changed, 38 insertions(+), 27 deletions(-) diff --git a/src/plugin/admin/app/controller/ConfigController.php b/src/plugin/admin/app/controller/ConfigController.php index 396e1ee..7e66781 100644 --- a/src/plugin/admin/app/controller/ConfigController.php +++ b/src/plugin/admin/app/controller/ConfigController.php @@ -92,12 +92,12 @@ class ConfigController extends Base $data[$section]['preload'] = !empty($items['preload']); $data[$section]['session'] = !empty($items['session']); $data[$section]['max'] = Util::filterNum($items['max'] ?? '30'); - $data[$section]['index']['id'] = Util::filterNum($items['index']['id'] ?? '10'); + $data[$section]['index']['id'] = Util::filterNum($items['index']['id'] ?? '0'); $data[$section]['index']['href'] = Util::filterUrlPath($items['index']['href'] ?? ''); $data[$section]['index']['title'] = htmlspecialchars($items['index']['title'] ?? '首页'); break; case 'theme': - $data[$section]['defaultColor'] = Util::filterNum($items['defaultColor'] ?? '1'); + $data[$section]['defaultColor'] = Util::filterNum($items['defaultColor'] ?? '2'); $data[$section]['defaultMenu'] = $items['defaultMenu'] ?? '' == 'dark-theme' ? 'dark-theme' : 'light-theme'; $data[$section]['defaultHeader'] = $items['defaultHeader'] ?? '' == 'dark-theme' ? 'dark-theme' : 'light-theme'; $data[$section]['allowCustom'] = !empty($items['allowCustom']); diff --git a/src/plugin/admin/app/middleware/AccessControl.php b/src/plugin/admin/app/middleware/AccessControl.php index 854efbf..5a6f531 100644 --- a/src/plugin/admin/app/middleware/AccessControl.php +++ b/src/plugin/admin/app/middleware/AccessControl.php @@ -23,7 +23,7 @@ class AccessControl implements MiddlewareInterface $msg = ''; if (!Auth::canAccess($controller, $action, $code, $msg)) { if ($request->expectsJson()) { - $response = json(['code' => $code, 'msg' => $msg, 'type' => 'error']); + $response = json(['code' => $code, 'msg' => $msg, 'data' => []]); } else { if ($code === 401) { $response = response(<< + - + - +