From 3f3890274bee9ae16c055c7fba14f3ef16c80616 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Mon, 18 Mar 2024 15:20:18 +0800 Subject: [PATCH] 20240318 --- class/Api.php | 5 +++++ data/update.log | 7 ++++++- templates/admin/footer.php | 2 +- templates/admin/setting/api.php | 5 +++-- templates/admin/setting/theme.php | 10 ++++++++-- templates/admin/static/embed.js | 26 ++++++++++++++++++++++++++ templates/admin/static/style.css | 18 ++++++++++++++++++ version.txt | 2 +- 8 files changed, 68 insertions(+), 7 deletions(-) diff --git a/class/Api.php b/class/Api.php index 2066e95..6a9e755 100644 --- a/class/Api.php +++ b/class/Api.php @@ -1689,6 +1689,11 @@ class Api { $subscribe = unserialize($subscribe); //api请求地址 $api_url = API_URL."/v1/check_subscribe.php?order_id=".$subscribe['order_id']."&email=".$subscribe['email']."&domain=".$domain; + + // 如果邮箱或者订单号为空,则返回提示 + if( empty($subscribe['order_id']) || empty($subscribe['email']) ) { + $this->return_json(-2000,'','此功能需要订阅!'); + } try { #GET HTTPS diff --git a/data/update.log b/data/update.log index 7bd7ba8..d0e0b15 100755 --- a/data/update.log +++ b/data/update.log @@ -272,4 +272,9 @@ CREATE INDEX on_options_key_IDX ON on_options ("key"); 5. 默认主题修改为默认隐藏链接描述 20240115 -1. PC后台新增:分类数量/链接数量/PHP版本显示 \ No newline at end of file +1. PC后台新增:分类数量/链接数量/PHP版本显示 + +20240318 +1. 获取API页面新增一键复制按钮 +2. 优化主题“使用中”的显示状态 +3. 修改后台底部年份展示 \ No newline at end of file diff --git a/templates/admin/footer.php b/templates/admin/footer.php index 83875ff..5b49288 100755 --- a/templates/admin/footer.php +++ b/templates/admin/footer.php @@ -1,6 +1,6 @@ diff --git a/templates/admin/setting/api.php b/templates/admin/setting/api.php index 9696ebe..efb277b 100644 --- a/templates/admin/setting/api.php +++ b/templates/admin/setting/api.php @@ -25,7 +25,7 @@
- +
@@ -49,11 +49,12 @@ + - + \ No newline at end of file diff --git a/templates/admin/setting/theme.php b/templates/admin/setting/theme.php index 7207a6d..26f18d1 100644 --- a/templates/admin/setting/theme.php +++ b/templates/admin/setting/theme.php @@ -29,7 +29,7 @@
- version ?> - (使用中) +
@@ -41,7 +41,13 @@
-

+
+

+ +
使用中
+ +
+
diff --git a/templates/admin/static/embed.js b/templates/admin/static/embed.js index 91c677d..5868805 100755 --- a/templates/admin/static/embed.js +++ b/templates/admin/static/embed.js @@ -757,6 +757,32 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 }); + // 一键复制 + form.on('submit(one_copy)', function(data){ + if( (data.field.SecretKey != '') && (data.field.username != '' ) ) { + let username = data.field.username; + let sk = data.field.SecretKey; + let token = md5(username + sk); + let api_domain = $("#api_domain").val(); + let result = `${api_domain}|${token}`; + lay.clipboard.writeText({ + text: result, + done: function() { + layer.msg("已复制!",{icon:1}); + }, + error: function() { + layer.msg("复制失败!",{icon:5}); + } + }); + } + else{ + layer.msg('SecretKey为空,请先生成!', {icon: 5}); + } + + //console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value} + return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 + }); + //添加链接 form.on('submit(add_link)', function(data){ $.post('/index.php?c=api&method=add_link',data.field,function(data,status){ diff --git a/templates/admin/static/style.css b/templates/admin/static/style.css index 8a8425d..84f70d2 100755 --- a/templates/admin/static/style.css +++ b/templates/admin/static/style.css @@ -151,6 +151,24 @@ /* .screenshot { height:220px; } */ + +.screenshot { + position: relative; /* 确保父容器是相对定位 */ + /* 其他样式 */ +} + +.in-use { + position: absolute; /* 绝对定位“使用中”标签 */ + top: 0; /* 距离顶部的距离 */ + left: 0px; /* 距离右侧的距离 */ + background-color: #ff5722; /* 背景颜色 */ + color: white; /* 文字颜色 */ + padding: 5px 10px; /* 内边距 */ + + box-shadow: 0px 0px 3px #888; /* 可选:添加一些阴影效果 */ +} + + .screenshot img{ width: 100%; height:240px; diff --git a/version.txt b/version.txt index 016c5fe..f436873 100755 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v0.9.34-20240115 \ No newline at end of file +v0.9.35-20240318 \ No newline at end of file