mirror of
https://github.com/tznb1/TwoNav.git
synced 2025-08-10 08:51:49 +00:00
v2.1.14-20240414
This commit is contained in:
@@ -35,8 +35,8 @@ if($db_config['type'] == 'sqlite'){
|
||||
$global_config = unserialize( get_db("global_config", "v", ["k" => "o_config"]) ); //全局配置
|
||||
$c = Get('c');
|
||||
$libs = $global_config['Libs'];
|
||||
$layui['js'] = $libs.'/Layui/v2.9.7/layui.js';
|
||||
$layui['css'] = $libs.'/Layui/v2.9.7/css/layui.css';
|
||||
$layui['js'] = $libs.'/Layui/v2.9.8/layui.js';
|
||||
$layui['css'] = $libs.'/Layui/v2.9.8/css/layui.css';
|
||||
$global_config['static_link'] = isset($global_config['static_link']) ? $global_config['static_link'] : 0;
|
||||
define('libs',$global_config['Libs']);
|
||||
define('SysVer',Get_Version());
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
static/Layui/v2.9.8/css/layui.css
Normal file
1
static/Layui/v2.9.8/css/layui.css
Normal file
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 322 KiB After Width: | Height: | Size: 322 KiB |
1
static/Layui/v2.9.8/layui.js
Normal file
1
static/Layui/v2.9.8/layui.js
Normal file
File diff suppressed because one or more lines are too long
@@ -228,7 +228,7 @@ function echo_Atool(){
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ATool 工具箱</title>
|
||||
<link rel="stylesheet" href="../static/Layui/v2.9.7/css/layui.css">
|
||||
<link rel="stylesheet" href="../static/Layui/v2.9.8/css/layui.css">
|
||||
<style>
|
||||
html, body {min-width: 1200px;background-color: #fff;position: relative;}
|
||||
.page-wrapper {width: 1200px;margin: 0 auto;padding: 0 15px;}
|
||||
@@ -280,7 +280,7 @@ function echo_Atool(){
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="del_otp" title="移除OTP登录验证">删OTP</a>
|
||||
</div>
|
||||
</script>
|
||||
<script src="../static/Layui/v2.9.7/layui.js"></script>
|
||||
<script src="../static/Layui/v2.9.8/layui.js"></script>
|
||||
<script src="../static/jquery/jquery-3.6.0.min.js"></script>
|
||||
<script src="../static/jquery/jquery.md5.js"></script>
|
||||
<script src="../templates/admin/js/public.js?v=<?php echo time();?>"></script>
|
||||
@@ -417,7 +417,7 @@ function echo_verify(){ ?>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ATool 工具箱</title>
|
||||
<link rel="stylesheet" href="../static/Layui/v2.9.7/css/layui.css">
|
||||
<link rel="stylesheet" href="../static/Layui/v2.9.8/css/layui.css">
|
||||
<link rel="stylesheet" href="../static/Other/login.css">
|
||||
</head>
|
||||
<body>
|
||||
@@ -442,7 +442,7 @@ function echo_verify(){ ?>
|
||||
</div>
|
||||
</div>
|
||||
<script src = "../static/jquery/jquery-3.6.0.min.js"></script>
|
||||
<script src = "../static/Layui/v2.9.7/layui.js"></script>
|
||||
<script src = "../static/Layui/v2.9.8/layui.js"></script>
|
||||
<script src = '../static/jquery/jquery.md5.js'></script>
|
||||
<script>
|
||||
layui.use(['form','jquery'], function () {
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
|
||||
// 检测是否已授权
|
||||
if(is_subscribe('bool')){
|
||||
//读取授权信息,判断是否存在秘钥
|
||||
$subscribe = unserialize(get_db('global_config','v',["k" => "s_subscribe"]));
|
||||
if(!isset($subscribe['public']) || empty($subscribe['public'])){
|
||||
//尝试从服务器下载秘钥
|
||||
$Res = ccurl("https://service.twonav.cn/api.php?fn=get_subscribe&order_id={$subscribe['order_id']}&email={$subscribe['email']}&domain={$subscribe['domain']}&mark=20230917",30,true);
|
||||
$data = json_decode($Res["content"], true);
|
||||
// 获取成功
|
||||
if($data["code"] == 200){
|
||||
$subscribe['public'] = $data['data']['public'];
|
||||
$subscribe['type'] = $data['data']['type'];
|
||||
$subscribe['type_name'] = $data['data']['type_name'];
|
||||
write_global_config('s_subscribe',$subscribe,'订阅信息');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,8 @@ INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALU
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230522.php', '1684762253', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230715.php', '1689427853', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230723.php', '1690119053', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20231218.php', '1702828800', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20240328.php', '1711296000', 'TRUE', '');
|
||||
|
||||
-- 创建用户表
|
||||
DROP TABLE IF EXISTS `global_user`;
|
||||
@@ -90,6 +92,8 @@ CREATE TABLE IF NOT EXISTS `user_categorys` (
|
||||
`description` text NOT NULL DEFAULT '' COMMENT '描述',
|
||||
`font_icon` text NOT NULL COMMENT '字体图标',
|
||||
`icon` text NOT NULL DEFAULT '' COMMENT '个性图标',
|
||||
`category_type` VARCHAR(255) NOT NULL DEFAULT 'link' COMMENT '分类类型',
|
||||
`max` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '显示数量',
|
||||
`extend` text NOT NULL COMMENT '扩展',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='用户分类';
|
||||
@@ -300,3 +304,21 @@ CREATE TABLE IF NOT EXISTS `user_article_list` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- 第三方用户表
|
||||
CREATE TABLE IF NOT EXISTS `third_party_user` (
|
||||
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`uid` int UNSIGNED NOT NULL COMMENT '用户id',
|
||||
`inlet` text NOT NULL COMMENT '入口',
|
||||
`provider` text NOT NULL COMMENT '提供商',
|
||||
`nickname` text NOT NULL COMMENT '昵称',
|
||||
`openid` text NOT NULL COMMENT '第三方用户标识',
|
||||
`access_token` text NOT NULL COMMENT '访问令牌',
|
||||
`refresh_token` text NOT NULL COMMENT '刷新令牌',
|
||||
`faceimg` text NOT NULL COMMENT '头像URL',
|
||||
`bind_time` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '绑定时间',
|
||||
`login_time` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '登录时间',
|
||||
`expires` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '到期时间',
|
||||
`extend` text NOT NULL COMMENT '扩展',
|
||||
FOREIGN KEY (`uid`) REFERENCES `global_user` (`ID`) ON DELETE CASCADE,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
|
||||
// 检测是否已授权
|
||||
if(is_subscribe('bool')){
|
||||
//读取授权信息,判断是否存在秘钥
|
||||
$subscribe = unserialize(get_db('global_config','v',["k" => "s_subscribe"]));
|
||||
if(!isset($subscribe['public']) || empty($subscribe['public'])){
|
||||
//尝试从服务器下载秘钥
|
||||
$Res = ccurl("https://service.twonav.cn/api.php?fn=get_subscribe&order_id={$subscribe['order_id']}&email={$subscribe['email']}&domain={$subscribe['domain']}&mark=20230917",30,true);
|
||||
$data = json_decode($Res["content"], true);
|
||||
// 获取成功
|
||||
if($data["code"] == 200){
|
||||
$subscribe['public'] = $data['data']['public'];
|
||||
$subscribe['type'] = $data['data']['type'];
|
||||
$subscribe['type_name'] = $data['data']['type_name'];
|
||||
write_global_config('s_subscribe',$subscribe,'订阅信息');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,8 @@ INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALU
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230522.php', '1684762253', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230715.php', '1689427853', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230723.php', '1690119053', 'TRUE', '');
|
||||
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20231218.php', '1702828800', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20240328.php', '1711296000', 'TRUE', '');
|
||||
|
||||
-- 创建用户表
|
||||
CREATE TABLE IF NOT EXISTS "global_user" (
|
||||
@@ -79,6 +80,8 @@ CREATE TABLE IF NOT EXISTS "user_categorys" (
|
||||
"description" TEXT(128) NOT NULL DEFAULT "",
|
||||
"font_icon" TEXT DEFAULT "",
|
||||
"icon" TEXT DEFAULT "",
|
||||
"category_type" TEXT DEFAULT "link",
|
||||
"max" text DEFAULT "",
|
||||
"extend" TEXT DEFAULT ""
|
||||
);
|
||||
|
||||
@@ -263,4 +266,22 @@ CREATE TABLE "user_article_list" (
|
||||
"cover" TEXT,
|
||||
"extend" TEXT,
|
||||
CONSTRAINT "id" UNIQUE ("id" ASC)
|
||||
);
|
||||
|
||||
-- 第三方用户表
|
||||
CREATE TABLE "third_party_user" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"uid" INTEGER NOT NULL,
|
||||
"inlet" TEXT NOT NULL DEFAULT "",
|
||||
"provider" TEXT NOT NULL DEFAULT "",
|
||||
"nickname" TEXT NOT NULL DEFAULT "",
|
||||
"openid" TEXT NOT NULL DEFAULT "",
|
||||
"access_token" TEXT NOT NULL DEFAULT "",
|
||||
"refresh_token" TEXT NOT NULL DEFAULT "",
|
||||
"faceimg" TEXT NOT NULL DEFAULT "",
|
||||
"bind_time" integer NOT NULL DEFAULT 0,
|
||||
"login_time" integer NOT NULL DEFAULT 0,
|
||||
"expires" integer NOT NULL DEFAULT 0,
|
||||
"extend" TEXT NOT NULL DEFAULT "",
|
||||
CONSTRAINT "uid" FOREIGN KEY ("uid") REFERENCES "global_user" ("ID") ON DELETE CASCADE
|
||||
);
|
||||
@@ -288,6 +288,7 @@ function write_category(){
|
||||
msg(-1,'操作类型错误');
|
||||
}
|
||||
|
||||
//读链接列表
|
||||
//读链接列表
|
||||
function read_link_list(){
|
||||
if($_GET['type'] == 'extend_list'){
|
||||
@@ -307,7 +308,8 @@ function read_link_list(){
|
||||
$page = empty(intval($_REQUEST['page'])) ? 1 : intval($_REQUEST['page']);
|
||||
$limit = empty(intval($_REQUEST['limit'])) ? 50 : intval($_REQUEST['limit']);
|
||||
$offset = ($page - 1) * $limit; //起始行号
|
||||
$where = ["uid"=> UID];
|
||||
$where = ["uid"=> UID,'fid[<=]'=>10000000];
|
||||
|
||||
//分类筛选
|
||||
if(!empty($fid)){
|
||||
$where['AND']['fid'] = $fid;
|
||||
@@ -317,6 +319,12 @@ function read_link_list(){
|
||||
// array_push($category,$fid);
|
||||
// $where['AND']['fid'] = $category;
|
||||
// }
|
||||
}else{
|
||||
//240405新增: 避免查找全部时将已停用分类下的链接显示出来
|
||||
$category_where = ['uid'=>UID,'fid'=>0,'status'=>1];
|
||||
$fid = select_db('user_categorys','cid', $category_where);
|
||||
$category_where['fid'] = $fid;
|
||||
$where['AND']['fid'] = array_merge ($fid,select_db('user_categorys','cid',$category_where));
|
||||
}
|
||||
//属性筛选
|
||||
if($_POST['property']==='0' || $_POST['property'] ==='1'){$where['AND']['property'] = ($_POST['property'] == 1?1:0);}
|
||||
@@ -1431,7 +1439,7 @@ function read_data(){
|
||||
msg(1,'您已开启离线模式,无法使用该功能!');
|
||||
}
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $_POST['url']);
|
||||
curl_setopt($ch, CURLOPT_URL, 'https://gitee.com/tznb/TwoNav_Resource/raw/master/connectivity_test.txt');
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
@@ -4,8 +4,8 @@ if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Fou
|
||||
//初始化
|
||||
session_name('TwoNav_initial');
|
||||
session_start();
|
||||
$layui['js'] = './static/Layui/v2.9.7/layui.js';
|
||||
$layui['css'] = './static/Layui/v2.9.7/css/layui.css';
|
||||
$layui['js'] = './static/Layui/v2.9.8/layui.js';
|
||||
$layui['css'] = './static/Layui/v2.9.8/css/layui.css';
|
||||
|
||||
//判断请求类型
|
||||
if($_SERVER['REQUEST_METHOD'] === 'POST'){
|
||||
|
||||
@@ -521,6 +521,9 @@ function Get_IP() {
|
||||
|
||||
//获取URL状态码
|
||||
function get_http_code($url,$TIMEOUT = 10 ,$NOBODY = true) {
|
||||
if(!preg_match("/^(http:\/\/|https:\/\/).*/",$url)){
|
||||
return false;
|
||||
}
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, 1);
|
||||
@@ -535,6 +538,9 @@ function get_http_code($url,$TIMEOUT = 10 ,$NOBODY = true) {
|
||||
}
|
||||
|
||||
function ccurl($url,$overtime = 3,$Referer = false,$post_data = false){
|
||||
if(!preg_match("/^(http:\/\/|https:\/\/).*/",$url)){
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$curl = curl_init ( $url ) ; //初始化
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, $overtime ); //超时
|
||||
@@ -565,6 +571,9 @@ function ccurl($url,$overtime = 3,$Referer = false,$post_data = false){
|
||||
}
|
||||
|
||||
function downFile($url, $file = '', $savePath = './data/temp/',$referer = '',$TIMEOUT = 60,$post_data = false){
|
||||
if(!preg_match("/^(http:\/\/|https:\/\/).*/",$url)){
|
||||
return false;
|
||||
}
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $TIMEOUT); //超时/秒
|
||||
|
||||
@@ -1 +1 @@
|
||||
v2.1.13-20240321
|
||||
v2.1.14-20240414
|
||||
@@ -15,6 +15,5 @@ layui.config({
|
||||
treetable: 'treetable-lay/treetable', //table树形扩展
|
||||
tableSelect: 'tableSelect/tableSelect', // table选择扩展
|
||||
xIcon: 'xIcon/xIcon', //图标选择器
|
||||
treeSelect: 'treeSelect/treeSelect', // 树形下拉选择器
|
||||
background: 'background/background' //随机背景图
|
||||
treeSelect: 'treeSelect/treeSelect'
|
||||
});
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/**
|
||||
* 随机背景图
|
||||
*/
|
||||
layui.define(['dropdown'], function (exports) {
|
||||
var background = {
|
||||
render: function (elem) {
|
||||
layui.dropdown.render({elem: elem
|
||||
,data: [{
|
||||
title: '博天(自适应/动漫)'
|
||||
,url: 'https://api.btstu.cn/sjbz/api.php?lx=dongman&method=zsy'
|
||||
,author:'https://api.btstu.cn/doc/sjbz.php'
|
||||
},{
|
||||
title: '博天(自适应/妹子)'
|
||||
,url: 'https://api.btstu.cn/sjbz/api.php?lx=meizi&method=zsy'
|
||||
,author:'https://api.btstu.cn/doc/sjbz.php'
|
||||
},{
|
||||
title: '博天(自适应/风景)'
|
||||
,url: 'https://api.btstu.cn/sjbz/api.php?lx=fengjing&method=zsy'
|
||||
,author:'https://api.btstu.cn/doc/sjbz.php'
|
||||
},{
|
||||
title: '博天(自适应/随机)'
|
||||
,url: 'https://api.btstu.cn/sjbz/api.php?lx=suiji&method=zsy'
|
||||
,author:'https://api.btstu.cn/doc/sjbz.php'
|
||||
},{
|
||||
title: '姬长信(PC/每日必应)'
|
||||
,url: 'https://api.isoyu.com/bing_images.php'
|
||||
,author:'https://api.isoyu.com'
|
||||
},{
|
||||
title: '樱花(PC/动漫)'
|
||||
,url: 'https://www.dmoe.cc/random.php'
|
||||
,author:'https://www.dmoe.cc'
|
||||
},{
|
||||
title: '梁炯灿(PC/动漫)'
|
||||
,url: 'https://tuapi.eees.cc/api.php?category=dongman&type=302'
|
||||
,author:'https://tuapi.eees.cc'
|
||||
},{
|
||||
title: '梁炯灿(PC/风景)'
|
||||
,url: 'https://tuapi.eees.cc/api.php?category=fengjing&type=302'
|
||||
,author:'https://tuapi.eees.cc'
|
||||
},{
|
||||
title: '梁炯灿(PC/必应)'
|
||||
,url: 'https://tuapi.eees.cc/api.php?category=biying&type=302'
|
||||
,author:'https://tuapi.eees.cc'
|
||||
},{
|
||||
title: '梁炯灿(PC/美女)'
|
||||
,url: 'https://tuapi.eees.cc/api.php?category=meinv&type=302'
|
||||
,author:'https://tuapi.eees.cc'
|
||||
},{
|
||||
title: '苏晓晴(PC/动漫)'
|
||||
,url: 'https://acg.toubiec.cn/random.php'
|
||||
,author:'https://acg.toubiec.cn'
|
||||
},{
|
||||
title: '墨天逸(PC/动漫)'
|
||||
,url: 'https://api.mtyqx.cn/api/random.php'
|
||||
,author:'https://api.mtyqx.cn/'
|
||||
},{
|
||||
title: '小歪(PC/动漫)'
|
||||
,url: 'https://api.ixiaowai.cn/api/api.php'
|
||||
,author:'https://api.ixiaowai.cn'
|
||||
},{
|
||||
title: '小歪(PC/MC酱)'
|
||||
,url: 'https://api.ixiaowai.cn/mcapi/mcapi.php'
|
||||
,author:'https://api.ixiaowai.cn'
|
||||
},{
|
||||
title: '小歪(PC/风景)'
|
||||
,url: 'https://api.ixiaowai.cn/gqapi/gqapi.php'
|
||||
,author:'https://api.ixiaowai.cn'
|
||||
},{
|
||||
title: '保罗(PC/动漫)'
|
||||
,url: 'https://api.paugram.com/wallpaper/?source=sina'
|
||||
,author:'https://api.paugram.com/help/wallpaper'
|
||||
},{
|
||||
title: '樱道(PC/动漫)'
|
||||
,url: 'https://api.r10086.com/img-api.php?type=动漫综合1'
|
||||
,author:'https://img.r10086.com/'
|
||||
}],click: function(obj){
|
||||
this.elem.val(obj.url);
|
||||
},style: 'width: 235px;'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports("background",background);
|
||||
});
|
||||
@@ -88,27 +88,18 @@ layui.use(['layer','form','miniTab'], function () {
|
||||
$("#console_log").text("");
|
||||
$("#console_log").append("浏览器UA:" + navigator.userAgent +"\n");
|
||||
$("#console_log").append("客户端时间:" + timestampToTime(Math.round(new Date() / 1000) ) +"\n");
|
||||
|
||||
var urls = [
|
||||
['资源节点-码云', 'https://gitee.com/tznb/TwoNav_Resource/raw/master/connectivity_test.txt']
|
||||
];
|
||||
urls.forEach(function(route) {
|
||||
var routeName = route[0];
|
||||
var url = route[1];
|
||||
$("#console_log").append("正在检测: " + routeName +"\n");
|
||||
$.ajax({
|
||||
url: get_api('read_data', 'connectivity_test'),
|
||||
type: 'POST',
|
||||
data: { url: url },
|
||||
//async: false,
|
||||
success: function(data, status) {
|
||||
layer.closeLast('loading');
|
||||
$("#console_log").append(data.msg + "\n");
|
||||
},error: function(jqXHR, textStatus, errorThrown) {
|
||||
layer.closeLast('loading');
|
||||
$("#console_log").append(routeName + ": 请求 " + url + " 发生错误:" + errorThrown + "\n");
|
||||
}
|
||||
});
|
||||
$("#console_log").append("正在检测: " + 'gitee' +"\n");
|
||||
$.ajax({
|
||||
url: get_api('read_data', 'connectivity_test'),
|
||||
type: 'POST',
|
||||
data: { id: '1' },
|
||||
success: function(data, status) {
|
||||
layer.closeLast('loading');
|
||||
$("#console_log").append(data.msg + "\n");
|
||||
},error: function(jqXHR, textStatus, errorThrown) {
|
||||
layer.closeLast('loading');
|
||||
$("#console_log").append('gitee' + ": 请求 " + url + " 发生错误:" + errorThrown + "\n");
|
||||
}
|
||||
});
|
||||
});
|
||||
//phpinfo
|
||||
|
||||
@@ -2,6 +2,20 @@
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main" style=" margin-left: 20px;">
|
||||
<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.14-20240414</h4>
|
||||
<ul>
|
||||
<li>[修复] 修复已知的安全漏洞提高安全性</li>
|
||||
<li>[修复] 分类停用时链接列表查找全部时出现已停用分类下的链接</li>
|
||||
<li>[升级] Layui组件由2.9.7升级到2.9.8</li>
|
||||
<li>[优化] Docker镜像支持在线下载安装包</li>
|
||||
<li>[移除] 和风天气插件 ( 因官方停止服务 )</li>
|
||||
<li>[移除] 随机背景图URL ( 大多数已经无法正常使用了 )</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">配色</li>
|
||||
<li>设置</li>
|
||||
<li>天气</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<!--配色Tab-->
|
||||
@@ -217,57 +216,6 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--天气Tab-->
|
||||
<div class="layui-tab-item">
|
||||
<div class="layui-form-item">
|
||||
<input id="WeatherPosition-input" type="hidden" value="<?php echo $theme_config['WeatherPosition'];?>">
|
||||
<label class="layui-form-label">插件位置</label>
|
||||
<div class="layui-input-inline">
|
||||
<select lay-verify="required" id="WeatherPosition" name="WeatherPosition" lay-search>
|
||||
<option value="0">关闭</option>
|
||||
<option value="1">头部工具条</option>
|
||||
<option value="2">正文右上角</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">插件显示的位置</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<input id="WeatherBackground-input" type="hidden" value="<?php echo $theme_config['WeatherBackground'];?>">
|
||||
<label class="layui-form-label">天气背景</label>
|
||||
<div class="layui-input-inline">
|
||||
<select lay-verify="required" id="WeatherBackground" name="WeatherBackground" lay-search>
|
||||
<option value="1">随天气变化</option>
|
||||
<option value="2">浅色</option>
|
||||
<option value="3">深色</option>
|
||||
<option value="4">透明</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">天气插件的背景颜色</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<input id="WeatherFontColor-input" type="hidden" value="<?php echo $theme_config['WeatherFontColor'];?>">
|
||||
<label class="layui-form-label">天气字体色</label>
|
||||
<div class="layui-input-inline">
|
||||
<select lay-verify="required" id="WeatherFontColor" name="WeatherFontColor" lay-search>
|
||||
<option value="1">随头部字体色</option>
|
||||
<option value="2">随标题字体色</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">天气插件的字体颜色</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">插件Key</label>
|
||||
<div class="layui-input-inline" style="width: 50%;">
|
||||
<input type="url" id="WeatherKey" name="WeatherKey" value="<?php echo $theme_config['WeatherKey'];?>" placeholder="" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">
|
||||
<a target="_blank" style="color:#03a9f4!important;" href='https://widget.qweather.com/create-simple/'>申请Key</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item" style="padding-top: 10px;">
|
||||
<div class="layui-input-block">
|
||||
@@ -288,7 +236,7 @@ var u = '<?php echo $u?>';
|
||||
var t = '<?php echo $theme;?>';
|
||||
var s = '<?php echo $_GET['source'];?>';
|
||||
var api = get_api('write_theme','config') + '&t=' + t;
|
||||
layui.use(['form','colorpicker','element','dropdown','background'], function(){
|
||||
layui.use(['form','colorpicker','element','dropdown'], function(){
|
||||
var form = layui.form;
|
||||
var colorpicker = layui.colorpicker;
|
||||
var dropdown = layui.dropdown;
|
||||
@@ -327,9 +275,7 @@ dropdown.render({elem: '#CardBackgroundColor-input',data:BackgroundColor ,click:
|
||||
dropdown.render({elem: '#OtherBackgroundColor-input',data:BackgroundColor ,click: function(obj){this.elem.val(obj.code);},style: 'width: 225px;'});
|
||||
dropdown.render({elem: '#SidebarBackgroundColor-input',data:BackgroundColor ,click: function(obj){this.elem.val(obj.code);},style: 'width: 225px;'});
|
||||
|
||||
//背景图下拉菜单
|
||||
layui.background.render("input[name='backgroundURL']");
|
||||
|
||||
|
||||
function layeropen(content,url){
|
||||
layer.open({
|
||||
type: 1
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
$night = $theme_config['night'] == 1 || ( $theme_config['night'] == 2 && (date('G') <= 12 || date('G') >= 19 )) ? 'mdui-theme-layout-dark':'';
|
||||
$background = $theme_config['backgroundURL'];
|
||||
$DescrRowNumber = intval($theme_config['DescrRowNumber']);
|
||||
$WeatherKey = $theme_config['WeatherKey'];
|
||||
$WeatherPosition = intval(empty($WeatherKey)?"0":$theme_config['WeatherPosition']);
|
||||
$referrer = $theme_config['referrer'];
|
||||
$protectA = (($referrer == 'link' || $referrer == 'link_icon') && $site['link_model'] == 'direct') ? 'referrerpolicy="same-origin"':'';
|
||||
$protectIMG = ($referrer == 'link_icon' || $referrer == 'icon' ) ? 'referrerpolicy="same-origin"':'';
|
||||
@@ -83,7 +81,6 @@ body{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($WeatherPosition==1){ echo '<div id="he-plugin-simple"></div>';} ?>
|
||||
<a class = "mdui-hidden-xs mdui-btn mdui-btn-icon" id="config" title = "主题设置" <?php if(!is_login) {echo 'style="display:none;"';}?>><i class="mdui-icon material-icons HFC"></i></a>
|
||||
<!-- 新版搜索框END -->
|
||||
</div>
|
||||
@@ -163,7 +160,6 @@ body{
|
||||
<!--左侧抽屉导航END-->
|
||||
<!--正文内容部分-->
|
||||
<div class="mdui-container">
|
||||
<?php if($WeatherPosition==2){ echo '<div style="position:fixed;z-index:1000;right:0px;width:160px;padding-right:0px;"><div id="he-plugin-simple"></div></div>'."\n";} ?>
|
||||
<div class="mdui-row">
|
||||
<!-- 遍历分类目录 -->
|
||||
<?php foreach ( $categorys as $category ) {
|
||||
@@ -240,41 +236,5 @@ var is_login = <?php echo is_login?'true':'false'; ?>;
|
||||
<script src = "<?php echo $libs?>/Other/holmes.js"></script>
|
||||
<script src = "<?php echo $libs; ?>/jquery/jquery.qrcode.min.js"></script>
|
||||
<script src = "<?php echo $theme_dir?>/static/embed.js?v=<?php echo $theme_ver;?>"></script>
|
||||
<?php
|
||||
// 如果Key不为空,则加载天气插件!
|
||||
if ($WeatherPosition != 0){
|
||||
$WeatherFontColor = $theme_config['WeatherFontColor'];
|
||||
if ($WeatherFontColor == 1){
|
||||
$WeatherFontColor = $theme_config['HeadFontColor'];
|
||||
}elseif($WeatherFontColor == 2){
|
||||
$WeatherFontColor = $theme_config['TitleFontColor'];
|
||||
}
|
||||
?>
|
||||
<!--天气插件-->
|
||||
<script>
|
||||
WIDGET = {
|
||||
"CONFIG": {
|
||||
"modules": "01234", //实况温度、城市、天气状况、预警
|
||||
"background": "<?php echo $theme_config['WeatherBackground'];?>", //背景颜色
|
||||
"tmpColor": "<?php echo $WeatherFontColor ?>", //温度文字颜色
|
||||
"tmpSize": "16",
|
||||
"cityColor": "<?php echo $WeatherFontColor ?>", //城市名文字颜色
|
||||
"citySize": "16",
|
||||
"aqiColor": "<?php echo $WeatherFontColor ?>", //空气质量文字颜色
|
||||
"aqiSize": "16",
|
||||
"weatherIconSize": "24", //天气图标尺寸
|
||||
"alertIconSize": "18", //预警图标尺寸
|
||||
"padding": "5px 1px 5px 1px", //边距
|
||||
"borderRadius": "5", //圆角
|
||||
"key": "<?php echo $WeatherKey;?>"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script>
|
||||
<!--天气插件End-->
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,10 +2,9 @@
|
||||
"name":"默认主题(加强)",
|
||||
"description":"默认主题(加强)",
|
||||
"homepage":"https://gitee.com/tznb/TwoNav",
|
||||
"version":"2.1.0",
|
||||
"update":"2023/09/28",
|
||||
"version":"2.1.1",
|
||||
"update":"2024/04/14",
|
||||
"author":"落幕",
|
||||
"screenshot":"https://s3.bmp.ovh/imgs/2022/04/17/8cac968a8cc8135c.png",
|
||||
"config": {
|
||||
"HeadBackgroundColor":"#3f51b5",
|
||||
"SidebarBackgroundColor":"",
|
||||
@@ -19,12 +18,7 @@
|
||||
"CardNum":"0",
|
||||
"backgroundURL":"",
|
||||
"DescrRowNumber":"2",
|
||||
"night":"0",
|
||||
"WeatherBackground":"1",
|
||||
"WeatherKey":"dd2e9ab2728d4b3c91245fe4057cb9ce",
|
||||
"WeatherFontColor":"1",
|
||||
"WeatherPosition":"2",
|
||||
"ClickLocation":"0"
|
||||
"night":"0"
|
||||
},
|
||||
"support":{
|
||||
"subitem":0,
|
||||
|
||||
Reference in New Issue
Block a user