This commit is contained in:
2024-07-11 15:41:14 +08:00
parent d0c67f6ad5
commit 4a1e70c604
2 changed files with 0 additions and 45 deletions

View File

@@ -26,48 +26,4 @@ class BaseCommonController extends BaseController
}
/**
* desc检查路径维护状态
*
* “===”完全匹配不能使用like
*
* authorwh
*/
protected function checkMaintain(){
$configs = Db::table(TabConf::$fa_sys_maintain_config)
->where('status','1')
->cache()
->select();
//模块
$strmodule = request()->module();
foreach ($configs as $config){
if($strmodule == $config['url']){
//模块维护中
return ['is_maintain'=>true,'msg'=>$config['msg'],'openid'=>$config['openid']];
}
}
//模块/控制器
$strcontroller = strtolower(request()->module().'/'.request()->controller());
foreach ($configs as $config){
if($strcontroller == $config['url']){
//模块维护中
return ['is_maintain'=>true,'msg'=>$config['msg'],'openid'=>$config['openid']];
}
}
//模块/控制器/方法
$straction = strtolower(request()->module().'/'.request()->controller().'/'.request()->action());
foreach ($configs as $config){
if($straction == $config['url']){
//模块维护中
return ['is_maintain'=>true,'msg'=>$config['msg'],'openid'=>isset($config['openid'])?$config['openid']:''];
}
}
//未维护
return ['is_maintain'=>false,'msg'=>'服务运行中'];
}
}

View File

@@ -34,7 +34,6 @@ class BaseController extends Controller
//校验系统维护状态 start
$chm = $this->checkMaintain();
if ($chm['is_maintain']) {
dump($chm);die;
if ($chm['users_ids']) {
//解析openid
if (!in_array(api_user_info('id'), explode(',', $chm['users_ids']))) {