mirror of
https://github.com/tznb1/TwoNav.git
synced 2025-08-10 08:51:49 +00:00
v2.1.03-20231019
This commit is contained in:
@@ -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'){
|
||||
|
||||
@@ -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) ? '保存失败,请核对信息是否有误<br />' : $msg);
|
||||
}
|
||||
//判断是否为IP
|
||||
if(preg_match("/^(\d+\.\d+\.\d+\.\d+):*\d*$/",$domain,$host)) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
v2.1.02-20231012
|
||||
v2.1.03-20231019
|
||||
@@ -163,15 +163,12 @@ layui.use(function(){
|
||||
current2.css('color','#03a9f4');
|
||||
current2.prepend('<i class="layui-icon layui-icon-cellphone" title="移动终端正在使用此主题"> ');
|
||||
$(`#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('<i class="fa fa-magic" style="color: #03a9f4;" title="正在使用"></i> ');
|
||||
$(`#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: '<body class="layui-fluid"><div class="layui-row" style = "margin-top :1em;"><div class="layui-col-sm9" style = "border-right:1px solid #e2e2e2;"><div style = "margin-left:1em;margin-right:1em;"><img src="'+data.screenshot+'" alt="" style = "max-width:100%;"></div></div><div class ="layui-col-sm3"><div style = "margin-left:1em;margin-right:1em;"><h1>'+data.name+'</h1><p>描述:'+data.description+'</p><p>版本:'+data.version+'</p><p>更新时间:'+data.update+'</p><p>作者:'+data.author+'</p><p >主页:<a style = "color:#01AAED;" href="'+data.homepage+'" target="_blank" rel = "nofollow">访问主页</a></p></div></div></div></body>'});
|
||||
|
||||
}
|
||||
});
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="layui-progress" lay-filter="progress" id="progress" style="display:none;">
|
||||
<div class="layui-progress-bar"></div>
|
||||
</div>
|
||||
<blockquote class="layui-elem-quote" style="margin-top: 10px;border-left: 5px solid #FF5722; color: #FF5722;" id='guide'>第一步:请上传数据,支持: db3 / html 格式(最大10M),使用前请参考<a href="https://gitee.com/tznb/TwoNav/wikis/pages?sort_id=7968661&doc_id=3767990" target="_blank" rel = "nofollow">帮助文档</a></blockquote>
|
||||
<blockquote class="layui-elem-quote" style="margin-top: 10px;border-left: 5px solid #FF5722; color: #FF5722;" id='guide'>第一步:请上传数据,支持: db3 / html / itabdata 格式(最大10M),使用前请参考<a href="https://gitee.com/tznb/TwoNav/wikis/pages?sort_id=7968661&doc_id=3767990" target="_blank" rel = "nofollow">帮助文档</a></blockquote>
|
||||
|
||||
<div class="layui-form-item" style="display:none;" id='fid'>
|
||||
<label class="layui-form-label">所属分类</label>
|
||||
|
||||
@@ -8,9 +8,6 @@ $data = empty($Notice)?[]:json_decode($Notice, true);
|
||||
|
||||
//输出最新动态
|
||||
function echo_notice_link($data){
|
||||
if(empty($data["notice"])){
|
||||
return;
|
||||
}
|
||||
echo '<div class="layui-card"><div class="layui-card-header"><i class="fa fa-bullhorn icon"></i>最新动态</div><div class="layui-card-body layui-text" id="notice_link">';
|
||||
foreach($data["notice"] as $value){
|
||||
echo "<div class=\"layuimini-notice\"><div class=\"layuimini-notice-title\"><a href=\"{$value['url']}\" target=\"_blank\">{$value['title']}</a></div></div>";
|
||||
@@ -20,9 +17,6 @@ function echo_notice_link($data){
|
||||
|
||||
//输出官方公告
|
||||
function echo_notice_text($data){
|
||||
if(empty($data["message"])){
|
||||
return;
|
||||
}
|
||||
echo '<div class="layui-card"><div class="layui-card-header"><i class="fa fa-bell-o icon"></i>官方公告</div><div class="layui-card-body layui-text layadmin-text" id="notice_text">';
|
||||
echo $data['message'];
|
||||
echo '</div></div>';
|
||||
@@ -39,7 +33,7 @@ if( $global_config['Sub_domain'] == 1 && check_purview('Sub_domain',1)){
|
||||
}
|
||||
if(!isset($_h)){
|
||||
$_h = static_link ? get_surl('{UUID}.html'):"./?u={$u}";
|
||||
$_l = static_link ? get_surl("login-{UUID}-{$USER_DB['Login']}.html"):"./c={$USER_DB['Login']}&u={$u}" ;
|
||||
$_l = static_link ? get_surl("login-{UUID}-{$USER_DB['Login']}.html"):"./?c={$USER_DB['Login']}&u={$u}" ;
|
||||
}
|
||||
require 'header.php';
|
||||
?>
|
||||
|
||||
@@ -60,7 +60,6 @@ if(!empty($Notice)){
|
||||
<div class="layui-btn-group">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="save_key">保存</button>
|
||||
<button class="layui-btn layui-btn-danger" lay-submit lay-filter="buy_vip" data-url="<?php echo empty($data['pay_rul']) ?'':$data['pay_rul']?>" >购买授权</button>
|
||||
<button class="layui-btn" lay-submit lay-filter="query_key">查询授权</button>
|
||||
<button class="layui-btn layui-bg-purple" type="button" id="validate" style="<?php echo empty($subscribe['order_id']) ? 'display:none;':''; ?>">正版验证</button>
|
||||
</div>
|
||||
|
||||
@@ -101,41 +100,6 @@ layui.use(['jquery','form'], function () {
|
||||
var layer = layui.layer;
|
||||
var $ = layui.jquery;
|
||||
var vcode;
|
||||
//查询订阅
|
||||
form.on('submit(query_key)', function(data){
|
||||
vcode = randomnum(6);
|
||||
index = layer.prompt({formType: 0,value: '',title: '请输入验证码: ' + vcode,shadeClose: false,"success":function(){
|
||||
$("input.layui-layer-input").on('keydown',function(e){
|
||||
if(e.which == 13) {
|
||||
query_key(data);
|
||||
}
|
||||
});
|
||||
}},function(){
|
||||
query_key(data)
|
||||
});
|
||||
});
|
||||
|
||||
function query_key(data) {
|
||||
layer.close(index);
|
||||
if($("input.layui-layer-input").val() != vcode){
|
||||
layer.msg('验证码错误', {icon: 5});
|
||||
return false;
|
||||
}
|
||||
layer.load(2, {shade: [0.1,'#fff']});
|
||||
$.post(get_api('other_services','query_key'),{'order_id':data.field.order_id,'email':data.field.email},function(data,status){
|
||||
layer.closeAll('loading');
|
||||
if(data.code == 200) {
|
||||
$("#order_id").val(data.data.order_id);
|
||||
$("#end_time").val(timestampToTime(data.data.end_time));
|
||||
$("#type_name").val(data.data.type_name);
|
||||
layer.msg(data.msg, {icon: 1,time: 10000});
|
||||
}else{
|
||||
layer.alert(data.msg,{icon:5,title:'查询结果',anim: 2,closeBtn: 0,btn: ['我知道了']});
|
||||
}
|
||||
}).fail(function () {
|
||||
layer.msg('请求失败', {icon: 5});
|
||||
});
|
||||
}
|
||||
|
||||
//保存订阅
|
||||
form.on('submit(save_key)', function(data){
|
||||
|
||||
@@ -5,7 +5,20 @@
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h4 class="layui-timeline-title">v2.1.02-20231012</h4>
|
||||
<h4 class="layui-timeline-title">v2.1.03-20231019</h4>
|
||||
<ul>
|
||||
<li>[修复] 站点地图时间格式问题</li>
|
||||
<li>[修复] 后台我的主页地址错误</li>
|
||||
<li>[变更] 移除授权管理页查询授权功能 ( 如需查询请联系客服 )</li>
|
||||
<li>[优化] 使用过渡页模板时若站点设置>链接模式不是过渡页面时自动修改配置</li>
|
||||
<li>[模板] WebStack-Hugo > 修复二级分类横向滚动条过大/顶部的管理入口未遵循系统设置是否显示</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h4 class="layui-timeline-title">v2.1.02-20231013</h4>
|
||||
<ul>
|
||||
<li>[优化] IP统计的记录方式,提高性能和稳定性</li>
|
||||
<li>[修复] 未在系统设置保存过设置时因缺少参数而导致部分页面加载异常</li>
|
||||
@@ -17,7 +30,7 @@
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h4 class="layui-timeline-title">v2.1.01-20231002</h4>
|
||||
<h4 class="layui-timeline-title">v2.1.01-20231003</h4>
|
||||
<ul>
|
||||
<li>[优化] 已部署国内服务器并接入了CDN加速和3个资源节点</li>
|
||||
<li>[新增] 系统设置>资源节点,可选自动/国内1/国内2/海外1</li>
|
||||
|
||||
Reference in New Issue
Block a user