From 33baa7726a21a6da01c34bc7b6f9fe5b4e7180bb Mon Sep 17 00:00:00 2001 From: hdm Date: Wed, 17 Nov 2021 10:33:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E8=A3=85bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/home/controller/Role.php | 16 +++++++--------- app/home/middleware.php | 14 ++++++++++++++ app/{ => home}/middleware/Install.php | 7 +++---- app/install/data/gouguoa.sql | 23 +++++++++++++++++++++++ app/install/view/index/step1.html | 4 ++-- app/install/view/index/step2.html | 4 ++-- app/install/view/index/step3.html | 4 ++-- app/middleware.php | 2 -- config/app.php | 13 ++++++------- 9 files changed, 59 insertions(+), 28 deletions(-) create mode 100644 app/home/middleware.php rename app/{ => home}/middleware/Install.php (60%) diff --git a/app/home/controller/Role.php b/app/home/controller/Role.php index 20d0f41..ffe8687 100644 --- a/app/home/controller/Role.php +++ b/app/home/controller/Role.php @@ -41,10 +41,10 @@ class Role extends BaseController { $param = get_params(); if (request()->isAjax()) { - $menuData = isset($param['menu']) ? $param['menu'] : 0; - $ruleData = isset($param['rule']) ? $param['rule'] : 0; - $param['menus'] = implode(',',$menuData); - $param['rules'] = implode(',',$ruleData); + $menuData = isset($param['menu']) ? $param['menu'] : 0; + $ruleData = isset($param['rule']) ? $param['rule'] : 0; + $param['menus'] = implode(',', $menuData); + $param['rules'] = implode(',', $ruleData); if (!empty($param['id']) && $param['id'] > 0) { try { validate(GroupCheck::class)->scene('edit')->check($param); @@ -72,19 +72,17 @@ class Role extends BaseController clear_cache('adminMenu'); clear_cache('adminRules'); return to_assign(); - } - else{ + } else { $id = isset($param['id']) ? $param['id'] : 0; $menu = get_admin_menu(); $rule = get_admin_rule(); - if($id > 0) { + if ($id > 0) { $group = get_admin_group_info($id); $role_menu = create_tree_list(0, $menu, $group['menus']); $role_rule = create_tree_list(0, $rule, $group['rules']); $role = Db::name('AdminGroup')->where(['id' => $id])->find(); View::assign('role', $role); - } - else{ + } else { $role_menu = create_tree_list(0, $menu, []); $role_rule = create_tree_list(0, $rule, []); } diff --git a/app/home/middleware.php b/app/home/middleware.php new file mode 100644 index 0000000..d3b1172 --- /dev/null +++ b/app/home/middleware.php @@ -0,0 +1,14 @@ +isAjax() ? to_assign(1, '请先完成系统安装引导') : redirect((string) url('/install/index')); - } + return $request->isAjax() ? to_assign(1, '请先完成系统安装引导') : redirect((string) url('/install/index')); } + return $next($request); } } diff --git a/app/install/data/gouguoa.sql b/app/install/data/gouguoa.sql index 8ad6b5f..2094421 100644 --- a/app/install/data/gouguoa.sql +++ b/app/install/data/gouguoa.sql @@ -408,6 +408,29 @@ INSERT INTO `oa_config`(`id`, `title`, `name`, `content`, `status`, `create_time INSERT INTO `oa_config`(`id`, `title`, `name`, `content`, `status`, `create_time`, `update_time`) VALUES (4, '其他配置', 'other', 'a:3:{s:2:\"id\";s:1:\"5\";s:6:\"author\";s:15:\"勾股工作室\";s:7:\"version\";s:13:\"v1.2021.07.28\";}', 1, 1613725791, 1635953640); +-- ---------------------------- +-- Table structure for oa_check +-- ---------------------------- +DROP TABLE IF EXISTS `oa_check`; +CREATE TABLE `oa_check` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '审核人ID', + `type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '审核类型 1报销审核人 2报销打款确认人 3发票审核人 4发票开票人', + `remark` varchar(1000) NULL DEFAULT '' COMMENT '备注', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', + `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '审核人配置'; + +-- ---------------------------- +-- Records of oa_check +-- ---------------------------- +INSERT INTO `oa_check`(`id`, `uid`, `type`, `remark`, `status`, `create_time`, `update_time`) VALUES (1, 1, 1, '初始化设置', 1, 1558681814, 0); +INSERT INTO `oa_check`(`id`, `uid`, `type`, `remark`, `status`, `create_time`, `update_time`) VALUES (2, 1, 2, '初始化设置', 1, 1558681814, 0); +INSERT INTO `oa_check`(`id`, `uid`, `type`, `remark`, `status`, `create_time`, `update_time`) VALUES (3, 1, 3, '初始化设置', 1, 1558681814, 0); +INSERT INTO `oa_check`(`id`, `uid`, `type`, `remark`, `status`, `create_time`, `update_time`) VALUES (4, 1, 4, '初始化设置', 1, 1558681814, 0); + -- ---------------------------- -- Table structure for oa_department -- ---------------------------- diff --git a/app/install/view/index/step1.html b/app/install/view/index/step1.html index d209372..7874877 100644 --- a/app/install/view/index/step1.html +++ b/app/install/view/index/step1.html @@ -3,7 +3,7 @@ - 勾股CMS安装 + 勾股OA安装 @@ -47,7 +47,7 @@ 2、您一旦安装使用勾股CMS系统,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权力的同时,受到相关的约束和限制。

- 接受协议 + 接受协议
diff --git a/app/install/view/index/step2.html b/app/install/view/index/step2.html index dd09f02..cebda22 100644 --- a/app/install/view/index/step2.html +++ b/app/install/view/index/step2.html @@ -3,7 +3,7 @@ - 勾股CMS安装 + 勾股OA安装 @@ -202,7 +202,7 @@ if ($('.yes').length != 8) { layer.tips('您的配置或权限不符合要求', this); } else { - location.href = "/install/index/step3"; + location.href = "/index.php?s=install/index/step3"; } }) diff --git a/app/install/view/index/step3.html b/app/install/view/index/step3.html index 53aad95..6431331 100644 --- a/app/install/view/index/step3.html +++ b/app/install/view/index/step3.html @@ -3,7 +3,7 @@ - 勾股CMS安装 + 勾股OA安装 @@ -158,7 +158,7 @@ }, 30 + Math.random() * 100); $.ajax({ - url: "/install/index/install", + url: "/index.php?s=/install/index/install", type: "post", data: data.field, beforeSend: function () { diff --git a/app/middleware.php b/app/middleware.php index a6638e1..6c7c6aa 100644 --- a/app/middleware.php +++ b/app/middleware.php @@ -10,8 +10,6 @@ return [ // \think\middleware\CheckRequestCache::class, // 多语言加载 // \think\middleware\LoadLangPack::class, - //验证勾股cms是否完成安装 - \app\middleware\Install::class, // Session初始化 'think\middleware\SessionInit', ]; diff --git a/config/app.php b/config/app.php index e69299c..b294366 100644 --- a/config/app.php +++ b/config/app.php @@ -14,14 +14,13 @@ return [ 'default_app' => 'home', // 默认时区 'default_timezone' => 'Asia/Shanghai', - // 自动多应用模式 - 'auto_multi_app' => true, + // 应用映射(自动多应用模式有效) - 'app_map' => [], - // 域名绑定(自动多应用模式有效) - 'domain_bind' => [], - // 禁止URL访问的应用列表(自动多应用模式有效) - 'deny_app_list' => ['common'], + 'app_map' => [], + // 域名绑定(自动多应用模式有效) + 'domain_bind' => [], + // 禁止URL访问的应用列表(自动多应用模式有效) + 'deny_app_list' => [], // 异常页面的模板文件 'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl',