From 91950de997bff11da58a61940f4334cd9c4f8698 Mon Sep 17 00:00:00 2001 From: "MI15\\Win" <10359480+tznb@user.noreply.gitee.com> Date: Mon, 18 Sep 2023 20:24:50 +0800 Subject: [PATCH] v2.0.40-20230917 --- index.php | 9 --------- system/api.php | 6 +++--- system/api_root.php | 3 ++- system/public.php | 8 ++++++++ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/index.php b/index.php index e9f6e83..17d3067 100644 --- a/index.php +++ b/index.php @@ -42,15 +42,6 @@ define('Debug',$global_config['Debug'] == 1); if(!in_array($c,[$global_config["Register"],'ico','icon'])){ $u = Get('u'); - if(empty($u) && $global_config['Sub_domain'] == 1 && is_subscribe('bool')){ - $cut = explode('.',$_SERVER["HTTP_HOST"]); - if(count($cut) == 3){ - $USER_DB = get_db("global_user", "*", ["User"=>reset($cut)]); - if(!empty($USER_DB) && check_purview('Sub_domain',1)){ - $_COOKIE['Default_User'] = $USER_DB['User'];unset($cut); - } - } - } $u = !empty($u)?$u:(!empty($_COOKIE['Default_User'])?$_COOKIE['Default_User']:(!empty($global_config['Default_User'])?$global_config['Default_User']:'admin'));//优先级:Get>Host>Cookie>默认用户>admin $USER_DB = get_db("global_user", "*", ["User"=>$u]); //没找到账号显示404 diff --git a/system/api.php b/system/api.php index 7eb0c86..dff5104 100644 --- a/system/api.php +++ b/system/api.php @@ -750,7 +750,7 @@ function write_link(){ if(!is_subscribe('bool')){ msg(-1,"未检测到有效授权,无法使用该功能!"); } - msg(1,'请更新系统后再试'); + msg(-1,'请更新系统后再试'); }elseif($_GET['type'] === 'msg_pull'){ session_start(); $key = $_POST['key']; @@ -844,7 +844,7 @@ function write_link(){ if(!is_subscribe('bool')){ msg(-1,"未检测到有效授权,无法使用该功能!"); } - msg(1,'请更新系统后再试'); + msg(-1,'请更新系统后再试'); }elseif($_GET['type'] == 'extend_list'){ if($GLOBALS['global_config']['link_extend'] != 1 ||!check_purview('link_extend',1)){ @@ -1351,7 +1351,7 @@ function write_theme(){ is_root(); if($global_config['offline']){msg(-1,"离线模式禁止下载主题!");} //离线模式 if(!is_subscribe('bool')){msg(-1,"未检测到有效授权,无法使用该功能!");} - msg(1,'请更新系统后再试'); + msg(-1,'请更新系统后再试'); //删除主题 }elseif($_GET['type'] == 'del'){ diff --git a/system/api_root.php b/system/api_root.php index 92f8311..0f68e86 100644 --- a/system/api_root.php +++ b/system/api_root.php @@ -98,6 +98,7 @@ function other_upsys(){ } catch (Exception $e) { msg(-1,'释放更新包,请检查写入权限');//解压出问题了 } + clean_cache(); usleep(1000*300); msg(1,'success'); } @@ -310,8 +311,8 @@ function write_subscribe(){ } if(stristr($data['domain'],$data['host'])){ - //unset($data['public']); // 记得删除 write_global_config('s_subscribe',$data,'订阅信息'); + clean_cache(); msg(1,'保存成功'); }else{ msg(-1,"您的订阅不支持当前域名 >> ".$_SERVER['HTTP_HOST']); diff --git a/system/public.php b/system/public.php index f649e15..0ee1065 100644 --- a/system/public.php +++ b/system/public.php @@ -782,3 +782,11 @@ function count_ip(){ write_user_count($k,'ip_count');//访问ip数+1 } } + +//清理缓存 +function clean_cache(){ + write_global_config('notice','','官方公告(缓存)'); + foreach(['home','login','transit','register','guide','article','apply','verify','guestbook'] as $v){ + write_global_config($v.'_cache','',$v.'_模板缓存'); + } +} \ No newline at end of file