diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index c9c04946..8752974b 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -30,7 +30,6 @@ class Index extends AdminBase } - public function welcome() { @@ -104,5 +103,4 @@ class Index extends AdminBase // 渲染输出 return $view->fetch('welcome'); } - } diff --git a/app/index/route/index.php b/app/index/route/index.php index a39ace6f..46136be3 100644 --- a/app/index/route/index.php +++ b/app/index/route/index.php @@ -13,6 +13,4 @@ use think\facade\Route; // 主页 Route::rule('/','index/index','get'); //主页 -Route::rule('welcome','index/welcome','get'); //欢迎页 - - +Route::rule('welcome','index/welcome','get'); //欢迎页 \ No newline at end of file diff --git a/app/login/controller/Index.php b/app/login/controller/Index.php index 09717b7e..064e906e 100644 --- a/app/login/controller/Index.php +++ b/app/login/controller/Index.php @@ -13,8 +13,6 @@ use think\facade\View; use app\login\validate\Yanzheng; // 引用验证类 use think\exception\ValidateException; -// 引用配置类 -use think\facade\Config; class Index @@ -31,8 +29,8 @@ class Index session(null); // 获取系统名称和版本号 - $list['webtitle'] = Config::get('shangma.webtitle'); - $list['version'] = Config::get('shangma.version'); + $list['webtitle'] = config('shangma.webtitle'); + $list['version'] = config('shangma.version'); $list['mobile'] = $mobile; View::assign('list',$list); @@ -152,15 +150,30 @@ class Index // 错误页面 public function myerror() { - // 获取系统名称和版本号 - $list['webtitle'] = Config::get('shangma.webtitle'); - $list['version'] = Config::get('shangma.version'); + $list['webtitle'] = config('shangma.webtitle'); + $list['version'] = config('shangma.version'); View::assign('list',$list); // 渲染输出 return View::fetch(); } + + + // 系统维护 + public function weihu() + { + // 获取系统名称和版本号 + $list = [ + 'shijian' => config('shangma.shijian') + ,'shichang' => config('shangma.shichang') + ,'webtitle' => '系统维护中' + ,'version' => config('shangma.version') + ]; + + View::assign('list',$list); + return View::fetch(); + } } diff --git a/app/login/route/login.php b/app/login/route/login.php index 895d7e7f..76aaf102 100644 --- a/app/login/route/login.php +++ b/app/login/route/login.php @@ -17,7 +17,7 @@ Route::group('', function () { Route::rule('','Index/yanzheng','post'); Route::rule('log','Index/shangmaLog','get'); # 配置更新 Route::rule('err','Index/myerror','get'); //错误页 - + Route::rule('weihu','Index/weihu','get'); //错误页 }); // 学生查询成绩登录 diff --git a/app/login/view/index/shangma_log.html b/app/login/view/index/shangma_log.html index 5d2828f4..70d14ded 100644 --- a/app/login/view/index/shangma_log.html +++ b/app/login/view/index/shangma_log.html @@ -63,6 +63,8 @@
增加年级名称、班级最大数、班级别名是否开启、学年节点等配置
+ 增加系统维护跳转 +
取消录入成绩时对十分位的限制
修复已知错误 diff --git a/app/login/view/index/weihu.html b/app/login/view/index/weihu.html new file mode 100644 index 00000000..d618475c --- /dev/null +++ b/app/login/view/index/weihu.html @@ -0,0 +1,25 @@ + + + + + {$list['webtitle']} {$list['version']} + + + + + {load href="__XADMIN__/css/font.css" /} + {load href="__XADMIN__/css/xadmin.css" /} + + +
+
+
+

+

系统维护中…… +
+ 从{$list.shijian}开始,大约{$list.shichang}小时。

+
+
+
+ + \ No newline at end of file diff --git a/app/middleware/Online.php b/app/middleware/Online.php index 891bb0cb..54dd7256 100644 --- a/app/middleware/Online.php +++ b/app/middleware/Online.php @@ -14,6 +14,13 @@ class Online */ public function handle($request, \Closure $next) { + $weihu = config('shangma.weihu'); + $adminid = session('admin.userid'); + if( $weihu == true && $adminid>2 ) + { + \app\facade\OnLine::jump('/login/weihu', '系统维护中~'); + } + // 判断是否在线,如果不在线则跳转 $online = session('?onlineCategory'); if($online == false) diff --git a/config/shangma.php b/config/shangma.php index 9c8589d6..7086a370 100644 --- a/config/shangma.php +++ b/config/shangma.php @@ -9,4 +9,7 @@ return [ // 版本号 'webtitle' => '码蚁成绩管理系统', 'version' => 'v1.3.5', + 'weihu' => true, + 'shijian' => '2020-9-2 11:54', + 'shichang' => '1', ];