mirror of
https://github.com/tznb1/TwoNav.git
synced 2025-08-10 08:51:49 +00:00
Compare commits
4 Commits
v2.1.02-20
...
v2.1.06-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01fdca800b | ||
|
|
77f357061a | ||
|
|
3ece39150c | ||
|
|
68464e34f9 |
@@ -48,15 +48,6 @@ if(!in_array($c,[$global_config["Register"],'ico','icon'])){
|
||||
$_GET['u'] = $global_config['static_link'] == 2 ? get_db("global_user", "User", ["ID"=>$UUID]) : $UUID;
|
||||
}
|
||||
$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
|
||||
|
||||
@@ -72,7 +72,7 @@ if(!empty($regcode_info['u_group'])){
|
||||
}
|
||||
|
||||
//读取用户组信息,如果用户组不存在则设为默认用户组
|
||||
if($UserGroup != 'default'){
|
||||
if(!in_array($UserGroup,['default','root','visitor'])){
|
||||
$Group = get_db('user_group','*',['code' => $UserGroup]);
|
||||
if(empty( $Group )){
|
||||
$UserGroup = 'default';
|
||||
|
||||
@@ -69,7 +69,7 @@ if($page == 'config_home'){
|
||||
msg(-1,"参数错误");
|
||||
}
|
||||
if(in_array($_GET['fn'],['guide','register'])){
|
||||
$theme_config_db = get_db('user_config','v',['k'=>'theme_'.$theme,'uid'=>UID]);
|
||||
$theme_config_db = get_db('global_config','v',['k'=>"theme_{$_GET['fn']}_{$theme}"]);
|
||||
}else{
|
||||
$theme_config_db = get_db('user_config','v',['t'=>'theme_'.$_GET['fn'],'k'=>$theme,'uid'=>UID]);
|
||||
}
|
||||
|
||||
@@ -1132,7 +1132,10 @@ function read_theme(){
|
||||
msgA(['code'=>1,'data'=>$themes,'current'=>$current,'referrer'=>($data['referrer'] ?? '')]);
|
||||
}
|
||||
function msg_tip(){
|
||||
msg(-1,'免费版不支持此功能,购买授权版<br /> <a href="https://gitee.com/tznb/TwoNav/wikis/pages?sort_id=7968669&doc_id=3767990" target="_blank" style="color: #1e9fff;">点击此处前往购买页面</a>');
|
||||
if(is_subscribe()){
|
||||
msg(-1,'请前往概要页面更新系统,未提示更新则尝试刷新页面<br />更新后即可解锁全部功能,如有疑问请联系客服');
|
||||
}
|
||||
msg(-1,'免费版不支持此功能<br /> <a href="https://gitee.com/tznb/TwoNav/wikis/pages?sort_id=7968669&doc_id=3767990" target="_blank" style="color: #1e9fff;">点击此处前往购买页面</a>');
|
||||
}
|
||||
|
||||
//主题下载/更新/删除
|
||||
@@ -1194,9 +1197,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'){
|
||||
@@ -1539,12 +1550,10 @@ function read_data(){
|
||||
$date = date('Ymd', strtotime("-$i days"));
|
||||
$dates[] = $date;
|
||||
}
|
||||
|
||||
$dates = array_reverse($dates);
|
||||
$day_data = [];
|
||||
foreach ($dates as $date) {
|
||||
$list = get_db('user_count', 'e', ['uid' => UID, 'k' => $date, 't' => 'ip_list']);
|
||||
$list = unserialize($list);
|
||||
$list = select_db('user_count','e',['uid'=>UID,'k'=>$date,'t'=>'access_ip']);
|
||||
$day_data[$date] = empty($list) ? [] : $list ;
|
||||
}
|
||||
msgA(['code'=>1,'data'=>$day_data]);
|
||||
|
||||
@@ -402,6 +402,7 @@ function other_root(){
|
||||
delfile($dir,30);
|
||||
$size = $_SESSION['CleanCacheSize'];
|
||||
unset($_SESSION['CleanCacheSize']);
|
||||
clean_cache();
|
||||
if($size == 0){
|
||||
msg(1,'暂无可清理缓存');
|
||||
}
|
||||
@@ -455,7 +456,8 @@ function other_services(){
|
||||
'order_id' => isset($_POST['order_id']) ? $_POST['order_id'] : "",
|
||||
'sysver' => SysVer,
|
||||
'ip' => Get_IP(),
|
||||
'method' => $_GET['type']
|
||||
'method' => $_GET['type'],
|
||||
'sys' => $_POST['sys']
|
||||
];
|
||||
$overtime = !isset($global_config['Update_Overtime']) ? 3 : ($global_config['Update_Overtime'] < 3 || $global_config['Update_Overtime'] > 60 ? 3 : $global_config['Update_Overtime']);
|
||||
// 判断操作类型
|
||||
@@ -465,11 +467,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)) {
|
||||
@@ -512,7 +515,7 @@ function other_services(){
|
||||
//如果不为空,则解析数据
|
||||
if(!empty($Notice)){
|
||||
$data = json_decode($Notice, true);
|
||||
$cache_time = 60; //缓存时间(秒);
|
||||
$cache_time = Debug ? 0 : 60; //缓存时间(秒);
|
||||
$reload = time() > $data["download_time"] + $cache_time; //是否更新
|
||||
}else{
|
||||
$reload = true; //需要刷新
|
||||
@@ -529,6 +532,7 @@ function other_services(){
|
||||
$new_data['download_time'] = time();
|
||||
$new_data['version'] = version_compare($new_data['version'],SysVer,'<') ? SysVer : $new_data['version'];
|
||||
write_global_config('notice',json_encode($new_data),'官方公告(缓存)');
|
||||
write_global_config('sys_switch',"{$new_data['sys_switch']}",'sys_switch');
|
||||
$data = $new_data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -732,8 +732,8 @@ function send_email($config){
|
||||
//统计访问ip数
|
||||
function count_ip(){
|
||||
$ip = Get_IP(); $k = date('Ymd'); $t = 'access_ip';
|
||||
if(!has_db('user_count',['uid'=>UID,'k'=>$k,'t'=>$t,'v'=>$ip])){
|
||||
insert_db("user_count",['uid'=>UID,'k'=>$k,'t'=>$t,'v'=>$ip]);
|
||||
if(!has_db('user_count',['uid'=>UID,'k'=>$k,'t'=>$t,'e'=>$ip])){
|
||||
insert_db("user_count",['uid'=>UID,'k'=>$k,'t'=>$t,'e'=>$ip,'v'=>0]);
|
||||
write_user_count($k,'ip_count');//访问ip数+1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
v2.1.02-20231012
|
||||
v2.1.06-20231113
|
||||
@@ -35,6 +35,7 @@
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="javascript:;" layuimini-content-href="LoginDevice" data-title="登录设备">登录设备</a></dd>
|
||||
<dd><a href="javascript:;" layuimini-content-href="SecuritySetting" data-title="安全设置">安全设置</a></dd>
|
||||
<dd><a href="javascript:;" layuimini-content-href="AccessRestrictions" data-title="访问限制">访问限制</a></dd>
|
||||
<dd><a href="javascript:;" layuimini-content-href="UserPassword" data-title="修改密码">修改密码</a></dd>
|
||||
<dd><hr></dd>
|
||||
<dd><a href="javascript:;" id="logout">退出登录</a></dd>
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
//分类切换按钮
|
||||
$("#btn-type").text(type == '&type=all' ?'收起':'展开');
|
||||
//将一级分类加入下拉框
|
||||
let old_val = $("#fid").val();
|
||||
$("#fid").empty();
|
||||
$("#fid").append("<option value=\"0\">无</option>");
|
||||
for (i = 0; i < count; i++) {
|
||||
@@ -80,6 +81,8 @@
|
||||
$("#fid").append("<option value=\""+res.data[i].cid+"\">"+res.data[i].name+"</option>");
|
||||
}
|
||||
}
|
||||
$("#fid").val(old_val);
|
||||
form.render('select');
|
||||
limit = false; //取消修改限制
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
//加载加密分组数据
|
||||
|
||||
@@ -9,14 +9,22 @@ layui.use(['layer','miniTab'], function(){
|
||||
|
||||
// 获取最新信息
|
||||
$.post(get_api('other_services','get_notice'),function(data,status){
|
||||
console.log(data );
|
||||
if(data.code == 200) {
|
||||
$("#new_ver a").text(data.version);
|
||||
$('#notice_link').text('');
|
||||
data.notice.forEach(notice => {
|
||||
$('#notice_link').append(`<div class="layuimini-notice"><div class="layuimini-notice-title"><a href="${notice.url}" target="_blank">${notice.title}</a></div></div>`);
|
||||
});
|
||||
$('#notice_text').html(data.message);
|
||||
if (Array.isArray(data.notice) && data.notice.length > 0) {
|
||||
data.notice.forEach(notice => {
|
||||
$('#notice_link').append(`<div class="layuimini-notice"><div class="layuimini-notice-title"><a href="${notice.url}" target="_blank">${notice.title}</a></div></div>`);
|
||||
});
|
||||
}else{
|
||||
$('.notice1').remove();
|
||||
}
|
||||
if(data.message.length > 0){
|
||||
$('#notice_text').html(data.message);
|
||||
}else{
|
||||
$('.notice2').remove();
|
||||
}
|
||||
|
||||
}
|
||||
init_update();
|
||||
$(".update").remove();
|
||||
|
||||
@@ -104,6 +104,9 @@ layui.use(function(){
|
||||
$.post(`./index.php?c=api&method=read_theme&dir=${dir}&u=${u}&cache=${cache ? 'no':'yes'}`, function (r, status) {
|
||||
layer.closeAll();
|
||||
if (r.code == 1) {
|
||||
if(r.referrer.length > 0){
|
||||
$('meta[name="referrer"]').replaceWith(`<meta name="referrer" content="${r.referrer}">`);
|
||||
}
|
||||
datas = r.data;
|
||||
render_data(r);
|
||||
} else {
|
||||
@@ -163,15 +166,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 +292,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 +302,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>'});
|
||||
|
||||
}
|
||||
});
|
||||
71
templates/admin/page/AccessRestrictions.php
Normal file
71
templates/admin/page/AccessRestrictions.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php $title='访问限制'; require 'header.php';?>
|
||||
<style>
|
||||
.layui-btn-container .layui-btn{border-width: 1px; border-style: solid; border-color: #FF5722!important; color: #FF5722!important;background: none;height: 30px; line-height: 30px; padding: 0 10px; font-size: 12px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
<form class="layui-form" lay-filter="form">
|
||||
<div class="layui-form layuimini-form layui-form-pane">
|
||||
<blockquote class="layui-elem-quote layui-text" style="">
|
||||
此功能<a href="https://gitee.com/tznb/TwoNav/wikis/pages?sort_id=7968669&doc_id=3767990" target="_blank">授权用户</a>专享
|
||||
</blockquote>
|
||||
<blockquote class="layui-elem-quote layui-text" style="">白名单模式 > 除了名单中的账号和分组一律不可访问您的主页<br />黑名单模式 > 黑名单中的账号和分组不可访问您的主页<br />匹配优先级: 用户组名单 > 账号名单<br />使用黑白名单模式时,未登录账号不可访问您的主页<br />名单中多个账号或分组时用半角的逗号,间隔<br />新增功能,难免会有BUG,如有遇到请反馈并关闭该功能</blockquote>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">访问限制</label>
|
||||
<div class="layui-input-inline" >
|
||||
<select name="mode">
|
||||
<option value="0" selected="">无限制</option>
|
||||
<option value="white">白名单模式</option>
|
||||
<option value="black">黑名单模式</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux"></div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">用户组名单</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="users_list" class="layui-textarea" placeholder='填写用户组代号,例如: group1,group2,group3'></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">账号名单</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="user_list" class="layui-textarea" placeholder='填写用户账号,例如: user1,user2,user3'></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">限制提示</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="prompt" class="layui-textarea" placeholder='留空时: 显示引导页
|
||||
以http开头时: 跳转到url
|
||||
其他内容则直接显示'></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block"><button class="layui-btn layui-btn-normal" lay-submit lay-filter="save">确认保存</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script src = "<?php echo $libs;?>/jquery/jquery-3.6.0.min.js"></script>
|
||||
<?php load_static('js.layui');?>
|
||||
<script>
|
||||
layui.use(['jquery','form','miniTab'], function () {
|
||||
var form = layui.form;
|
||||
var layer = layui.layer;
|
||||
var $ = layui.jquery;
|
||||
var miniTab = layui.miniTab;
|
||||
miniTab.listen();
|
||||
|
||||
//监听提交
|
||||
form.on('submit(save)', function (data) {
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -195,13 +195,18 @@ layui.use(['jquery','form','upload'], function () {
|
||||
});
|
||||
//监听提交
|
||||
form.on('submit(save)', function (data) {
|
||||
layer.load(0);
|
||||
$.post('./index.php?c=api&method=write_site_setting&u='+u,data.field,function(data,status){
|
||||
layer.closeLast('loading');
|
||||
if(data.code == 1) {
|
||||
layer.msg(data.msg, {icon: 1});
|
||||
}else{
|
||||
layer.msg(data.msg, {icon: 5});
|
||||
}
|
||||
});
|
||||
}).fail(function(xhr, textStatus, errorThrown) {
|
||||
layer.closeLast('loading');
|
||||
layer.alert('请求失败');
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<?php if(defined('referrer')) echo '<meta name="referrer" content="' . referrer . '">'."\n";?>
|
||||
<meta name="referrer" content="no-referrer-when-downgrade">
|
||||
<?php load_static('css');if($awesome) echo str_replace('#',$libs,' <link rel="stylesheet" href="#/Font-awesome/4.7.0/css/font-awesome.css" media="all">'."\n");?>
|
||||
<script>var u = "<?php echo U;?>";</script>
|
||||
</head>
|
||||
|
||||
@@ -8,10 +8,7 @@ $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">';
|
||||
echo '<div class="layui-card notice1"><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,10 +17,7 @@ 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 '<div class="layui-card notice2"><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';
|
||||
?>
|
||||
|
||||
@@ -69,16 +69,22 @@ layui.use(['layer','form','miniTab'], function () {
|
||||
});
|
||||
//一键诊断
|
||||
$('.diagnose').on('click', function(){
|
||||
layer.load(0);
|
||||
$("#console_log").text("");
|
||||
$("#console_log").append("浏览器UA:" + navigator.userAgent +"\n");
|
||||
$("#console_log").append("客户端时间:" + timestampToTime(Math.round(new Date() / 1000) ) +"\n");
|
||||
$.post(get_api('read_data','diagnostic_log'),function(data,status){
|
||||
layer.closeLast('loading');
|
||||
$("#console_log").append(data.msg);
|
||||
}).fail(function(xhr, textStatus, errorThrown) {
|
||||
layer.closeLast('loading');
|
||||
layer.alert('请求失败');
|
||||
});
|
||||
});
|
||||
|
||||
//连通测试
|
||||
$('.connectivity_test').on('click', function(){
|
||||
layer.load(0);
|
||||
$("#console_log").text("");
|
||||
$("#console_log").append("浏览器UA:" + navigator.userAgent +"\n");
|
||||
$("#console_log").append("客户端时间:" + timestampToTime(Math.round(new Date() / 1000) ) +"\n");
|
||||
@@ -94,12 +100,13 @@ layui.use(['layer','form','miniTab'], function () {
|
||||
url: get_api('read_data', 'connectivity_test'),
|
||||
type: 'POST',
|
||||
data: { url: url },
|
||||
async: false,
|
||||
//async: false,
|
||||
success: function(data, status) {
|
||||
$("#console_log").append(data.msg + "\n");
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
$("#console_log").append(routeName + ": 请求 " + url + " 发生错误:" + errorThrown + "\n");
|
||||
layer.closeLast('loading');
|
||||
$("#console_log").append(data.msg + "\n");
|
||||
},error: function(jqXHR, textStatus, errorThrown) {
|
||||
layer.closeLast('loading');
|
||||
$("#console_log").append(routeName + ": 请求 " + url + " 发生错误:" + errorThrown + "\n");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -146,21 +153,31 @@ layui.use(['layer','form','miniTab'], function () {
|
||||
});
|
||||
//清理缓存
|
||||
$('.CleanCache').on('click', function(){
|
||||
layer.load(0);
|
||||
$.post(get_api('other_root','CleanCache'),function(data,status){
|
||||
layer.closeLast('loading');
|
||||
if(data.code == 1){
|
||||
layer.msg(data.msg,{icon: 1})
|
||||
} else{
|
||||
layer.msg(data.msg,{icon: 5});
|
||||
}
|
||||
}).fail(function(xhr, textStatus, errorThrown) {
|
||||
layer.closeLast('loading');
|
||||
layer.alert('请求失败');
|
||||
});
|
||||
});
|
||||
//数据库升级
|
||||
$('.db_upgrade').on('click', function(){
|
||||
layer.load(0);
|
||||
$("#console_log").text("");
|
||||
$("#console_log").append(`正在处理中,请勿操作页面...\n`);
|
||||
$.post(get_api("other_upsys"),{"i":4,"pattern":"manual"}, function(data, status) {
|
||||
layer.closeLast('loading');
|
||||
$("#console_log").text("");
|
||||
$("#console_log").append(`${data.msg}\n`);
|
||||
}).fail(function(xhr, textStatus, errorThrown) {
|
||||
layer.closeLast('loading');
|
||||
layer.alert('请求失败');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -56,11 +56,21 @@ if(!empty($Notice)){
|
||||
<input type="text" name="type_name" id ="type_name" value="<?php echo $subscribe['type_name'] ?? ''; ?>" autocomplete="off" placeholder="若未正确显示请点击保存设置" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(get_db('global_config','v',["k" => "sys_switch"]) == 'show' && $subscribe['type'] == '3'){ ?>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">版本切换</label>
|
||||
<div class="layui-input-inline" >
|
||||
<select name="sys" id="sys">
|
||||
<option value="biaozhun" selected>标准版</option>
|
||||
<option value="gaoji" >高级版</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">希望使用的系统版本 ( 下次更新时 )</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<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,42 +111,8 @@ 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});
|
||||
});
|
||||
}
|
||||
|
||||
$("#sys").val('<?php echo empty($subscribe['sys']) ? 'biaozhun':$subscribe['sys']; ?>');
|
||||
form.render('select');
|
||||
//保存订阅
|
||||
form.on('submit(save_key)', function(data){
|
||||
var order_id = data.field.order_id;
|
||||
@@ -149,7 +125,7 @@ layui.use(['jquery','form'], function () {
|
||||
return false;
|
||||
}
|
||||
layer.load(2, {shade: [0.1,'#fff']});
|
||||
$.post(get_api('other_services','save_key'),{'order_id':data.field.order_id,'email':data.field.email},function(data,status){
|
||||
$.post(get_api('other_services','save_key'),{'order_id':data.field.order_id,'email':data.field.email,'sys':data.field.sys},function(data,status){
|
||||
layer.closeAll('loading');
|
||||
if(data.code == 200) {
|
||||
$("#order_id").val(data.data.order_id);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php $title='主题管理';$awesome=true; require 'header.php';?>
|
||||
<?php $title='主题管理';$awesome=true; define('referrer','same-origin'); require 'header.php';?>
|
||||
<style>
|
||||
.tab-header .layui-btn.layui-this{border-color: #1E9FFF; color: #1E9FFF;}
|
||||
.screenshot{
|
||||
@@ -25,7 +25,6 @@
|
||||
<script src="<?php echo $libs;?>/jquery/jquery.lazyload.min.js"></script>
|
||||
<script src="./templates/admin/js/public.js?v=<?php echo $Ver;?>"></script>
|
||||
<?php load_static('js');?>
|
||||
<script src="./templates/admin/js/theme.js?v=<?php echo $Ver;?>"></script>
|
||||
<script>
|
||||
const is_admin = <?php echo $USER_DB['UserGroup'] === 'root' ? 'true' : 'false'; ?>;
|
||||
const theme_set = <?php echo check_purview('theme_set',1) ? 'true' : 'false'; ?>;
|
||||
@@ -33,4 +32,5 @@
|
||||
const guestbook = <?php echo check_purview('guestbook',1) ? 'true' : 'false'; ?>;
|
||||
const article = <?php echo check_purview('article',1) ? 'true' : 'false'; ?>;
|
||||
const loginAddress = '<?php echo $USER_DB['Login']; ?>';
|
||||
</script>
|
||||
</script>
|
||||
<script src="./templates/admin/js/theme.js?v=<?php echo $Ver;?>"></script>
|
||||
@@ -5,7 +5,62 @@
|
||||
<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.06-20231113</h4>
|
||||
<ul>
|
||||
<li>[修复] 开启离线模式时概要页依旧获取在线数据,V0921</li>
|
||||
<li>[优化] 为部分操作添加处理中的效果( 防止网络极差的用户以为没点到而重复点击 )</li>
|
||||
<li>[新增] 内置用户组新增:访客 (代号:visitor,处于该用户组的账号登录后跳转到默认用户的主页,配合引导页使用实现需注册登录才能访问站点)</li>
|
||||
<li>[备注] 由于访客无权限进入后台,所以也无法自助修改密码</li>
|
||||
<li>[新增] 在用户组列表中显示内置用户组 ( 默认/访客/站长 )</li>
|
||||
<li>[变更] 系统设置中的默认分组允许设置为内置用户组 ( 例如设为访客 )</li>
|
||||
<li>[新增] 访问限制 (右上角账号下拉),可设置:无限制/白名单/黑名单,具体查看页面中的说明</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.05-20231107</h4>
|
||||
<ul>
|
||||
<li>[修复] 使用MySQL/MariaDB数据库时记录访客IP错误</li>
|
||||
<li>[修复] 注册模板/引导页模板配置无法正常读取</li>
|
||||
<li>[模板] 主页模板新增 > Snavigation ( 简约型的模板,点击时间显示书签数据 )</li>
|
||||
<li>[模板] 引导页模板新增 > 無名の主页</li>
|
||||
<li>[模板] WebStack-Hugo > 搜索栏新增站内搜索选项,用于解决同时开启站内搜索和搜索热词时遮挡问题</li>
|
||||
<li>[模板] 挽风导航V1.0 > CSS样式细节优化 </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.04-20231101</h4>
|
||||
<ul>
|
||||
<li>[修复] 连续添加分类时未正确添加到所选的父分类中</li>
|
||||
<li>[修复] 使用MySQL/MariaDB数据库时文章图片可能不显示的bug</li>
|
||||
<li>[优化] 二级域名功能支持已知的双后缀顶级域名(例如example.com.cn)</li>
|
||||
<li>[新增] Docker镜像增加intl模块</li>
|
||||
<li>[模板] WebStack-Hugo > 修复过渡页模板logo设置无效</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.03-20231020</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 +72,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