From 68464e34f97937b7786d16c9fca4f7dc6afc56ab Mon Sep 17 00:00:00 2001 From: "MI15\\Win" <10359480+tznb@user.noreply.gitee.com> Date: Fri, 20 Oct 2023 00:34:17 +0800 Subject: [PATCH] v2.1.03-20231019 --- system/api.php | 10 +++++++- system/api_root.php | 4 ++- system/install.php | 12 +++++---- system/version.txt | 2 +- templates/admin/js/theme.js | 6 +---- templates/admin/page/data_control.php | 2 +- templates/admin/page/home.php | 8 +----- templates/admin/page/root/vip.php | 36 --------------------------- templates/admin/page/updatelog.php | 17 +++++++++++-- 9 files changed, 38 insertions(+), 59 deletions(-) diff --git a/system/api.php b/system/api.php index 9dc0702..ee95bce 100644 --- a/system/api.php +++ b/system/api.php @@ -1194,9 +1194,17 @@ function write_theme(){ } }else{ $s_templates[$fn] = $name; + if($fn == 'transit'){ + $site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site'])); + if($site['link_model'] != 'Transition'){ + $site['link_model'] = 'Transition'; + update_db("user_config",["v"=>$site],["k"=>'s_site',"uid"=>UID]); + $msg = ',已同步链接模式为过渡页面'; + } + } } //更新数据 - update_db('user_config',['v'=>$s_templates],['uid'=>UID,'k'=>'s_templates'],[1,'设置成功']); + update_db('user_config',['v'=>$s_templates],['uid'=>UID,'k'=>'s_templates'],[1,"设置成功{$msg}"]); //配置主题信息 }elseif($_GET['type'] == 'config'){ diff --git a/system/api_root.php b/system/api_root.php index 82484ee..8f5586c 100644 --- a/system/api_root.php +++ b/system/api_root.php @@ -402,6 +402,7 @@ function other_root(){ delfile($dir,30); $size = $_SESSION['CleanCacheSize']; unset($_SESSION['CleanCacheSize']); + clean_cache(); if($size == 0){ msg(1,'暂无可清理缓存'); } @@ -465,11 +466,12 @@ function other_services(){ msg(-1,'请求官方服务器失败,请稍后再试'); } $data = json_decode($Res["content"], true); + $msg = $data['msg']; // 如果是保存设置 if($_GET['type'] == 'save_key'){ $data = $data['data']; if(!isset($data['order_id']) || empty($data['order_id'])){ - msg(-1,'保存失败,请核对信息是否有误'); + msg(-1,empty($msg) ? '保存失败,请核对信息是否有误
' : $msg); } //判断是否为IP if(preg_match("/^(\d+\.\d+\.\d+\.\d+):*\d*$/",$domain,$host)) { diff --git a/system/install.php b/system/install.php index 98a7e2a..4e8560b 100644 --- a/system/install.php +++ b/system/install.php @@ -150,7 +150,7 @@ $db_config = array( // mysql if($_POST['db_type'] === 'mysql' || $_POST['db_type'] === 'mariadb'){ if( !isset($_POST['db_host']) || !isset($_POST['db_port']) || !isset($_POST['db_name']) || !isset($_POST['db_user']) || !isset($_POST['db_password']) ){ - msg(-1,'MySQL配置错误,请检查..'); + msg(-1,'数据库配置错误,请检查..'); } require (DIR.'/system/Medoo.php'); //载入框架 @@ -164,13 +164,15 @@ $db_config = array( 'password' => $_POST['db_password'], 'charset' => 'utf8mb4' ]); + $ver = $db->info ()['version']; if($_POST['db_type'] === 'mysql'){ - if(version_compare($db->info ()['version'],'5.6.0','<')){ - msg(-1,'MySQL数据库版本不能低于5.6,当前版本:'.$db->info ()['version']); + if(version_compare($ver,'5.6.0','<')){ + msg(-1,'MySQL数据库版本不能低于5.6,当前版本:'.$ver); } }else{ - if(version_compare($db->info ()['version'],'10.1.0','<')){ - msg(-1,'MariaDB数据库版本不能低于10.1,当前版本:'.$db->info ()['version']); + preg_match('/(\d+\.\d+\.\d+)-MariaDB/', $ver, $matches); + if(version_compare($matches[1],'10.1.0','<')){ + msg(-1,'MariaDB数据库版本不能低于10.1,当前版本:'.$ver); } } }catch (Exception $e) { diff --git a/system/version.txt b/system/version.txt index 97a62fa..c65ea2a 100644 --- a/system/version.txt +++ b/system/version.txt @@ -1 +1 @@ -v2.1.02-20231012 \ No newline at end of file +v2.1.03-20231019 \ No newline at end of file diff --git a/templates/admin/js/theme.js b/templates/admin/js/theme.js index 91fa699..0dc260d 100644 --- a/templates/admin/js/theme.js +++ b/templates/admin/js/theme.js @@ -163,15 +163,12 @@ layui.use(function(){ current2.css('color','#03a9f4'); current2.prepend(' '); $(`#col_${d.current.home_pad}`).prependTo($row); - //if(current1.is(current2)){ $("#set:first").remove(); } - }else{ if(d.current[active] !== null && d.current[active] !== undefined && d.current[active].length > 0){ var current = $(`#t_${d.current[active]}`); current.css('color','#03a9f4'); current.prepend(' '); $(`#col_${d.current[active]}`).prependTo($row); - //$("#set:first").remove(); } } $(`#col_default`).prependTo($row); @@ -292,7 +289,7 @@ layui.use(function(){ $.post(get_api('write_theme','set'),{type:type,name:name,fn:fn},function(data,status){ if( data.code == 1 ) { layer.msg(data.msg, {icon: 1}); - setTimeout(() => {load_data(active);}, 800); + setTimeout(() => {load_data(active);}, (data.msg == '设置成功' ? 800 : 2000)); }else{ layer.msg(data.msg, {icon: 5}); } @@ -302,6 +299,5 @@ layui.use(function(){ //主题详情 function theme_detail(data){ layer.open({type: 1,scrollbar: false,maxmin: false,shadeClose: true,resize: false,title: data.name + ' - 主题详情',area: ['60%', '59%'],content: '

'+data.name+'

描述:'+data.description+'

版本:'+data.version+'

更新时间:'+data.update+'

作者:'+data.author+'

主页:访问主页

'}); - } }); \ No newline at end of file diff --git a/templates/admin/page/data_control.php b/templates/admin/page/data_control.php index f661a91..89f4919 100644 --- a/templates/admin/page/data_control.php +++ b/templates/admin/page/data_control.php @@ -34,7 +34,7 @@ -
第一步:请上传数据,支持: db3 / html 格式(最大10M),使用前请参考帮助文档
+
第一步:请上传数据,支持: db3 / html / itabdata 格式(最大10M),使用前请参考帮助文档