From 01fdca800bf4529bf43c296608f384f307371b41 Mon Sep 17 00:00:00 2001 From: "MI15\\Win" <10359480+tznb@user.noreply.gitee.com> Date: Tue, 14 Nov 2023 01:25:59 +0800 Subject: [PATCH] v2.1.06-20231113 --- system/Register.php | 2 +- system/api.php | 5 +- system/version.txt | 2 +- templates/admin/index.php | 1 + templates/admin/js/home-root.js | 18 ++++-- templates/admin/page/AccessRestrictions.php | 71 +++++++++++++++++++++ templates/admin/page/SiteSetting.php | 7 +- templates/admin/page/home.php | 4 +- templates/admin/page/root/tool.php | 27 ++++++-- templates/admin/page/updatelog.php | 17 ++++- 10 files changed, 137 insertions(+), 17 deletions(-) create mode 100644 templates/admin/page/AccessRestrictions.php diff --git a/system/Register.php b/system/Register.php index d6a7c26..be0f0e2 100644 --- a/system/Register.php +++ b/system/Register.php @@ -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'; diff --git a/system/api.php b/system/api.php index 11afa84..5794d72 100644 --- a/system/api.php +++ b/system/api.php @@ -1132,7 +1132,10 @@ function read_theme(){ msgA(['code'=>1,'data'=>$themes,'current'=>$current,'referrer'=>($data['referrer'] ?? '')]); } function msg_tip(){ - msg(-1,'免费版不支持此功能,购买授权版
点击此处前往购买页面'); + if(is_subscribe()){ + msg(-1,'请前往概要页面更新系统,未提示更新则尝试刷新页面
更新后即可解锁全部功能,如有疑问请联系客服'); + } + msg(-1,'免费版不支持此功能
点击此处前往购买页面'); } //主题下载/更新/删除 diff --git a/system/version.txt b/system/version.txt index a4bd2ef..e65ab03 100644 --- a/system/version.txt +++ b/system/version.txt @@ -1 +1 @@ -v2.1.05-20231106 \ No newline at end of file +v2.1.06-20231113 \ No newline at end of file diff --git a/templates/admin/index.php b/templates/admin/index.php index cbc3808..423588c 100644 --- a/templates/admin/index.php +++ b/templates/admin/index.php @@ -35,6 +35,7 @@
登录设备
安全设置
+
访问限制
修改密码

退出登录
diff --git a/templates/admin/js/home-root.js b/templates/admin/js/home-root.js index 7ef6244..26c4854 100644 --- a/templates/admin/js/home-root.js +++ b/templates/admin/js/home-root.js @@ -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(`
`); - }); - $('#notice_text').html(data.message); + if (Array.isArray(data.notice) && data.notice.length > 0) { + data.notice.forEach(notice => { + $('#notice_link').append(`
`); + }); + }else{ + $('.notice1').remove(); + } + if(data.message.length > 0){ + $('#notice_text').html(data.message); + }else{ + $('.notice2').remove(); + } + } init_update(); $(".update").remove(); diff --git a/templates/admin/page/AccessRestrictions.php b/templates/admin/page/AccessRestrictions.php new file mode 100644 index 0000000..463d0ac --- /dev/null +++ b/templates/admin/page/AccessRestrictions.php @@ -0,0 +1,71 @@ + + + +
+
+
+
+
+ 此功能授权用户专享 +
+
白名单模式 > 除了名单中的账号和分组一律不可访问您的主页
黑名单模式 > 黑名单中的账号和分组不可访问您的主页
匹配优先级: 用户组名单 > 账号名单
使用黑白名单模式时,未登录账号不可访问您的主页
名单中多个账号或分组时用半角的逗号,间隔
新增功能,难免会有BUG,如有遇到请反馈并关闭该功能
+ +
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/templates/admin/page/SiteSetting.php b/templates/admin/page/SiteSetting.php index a63330b..3af49b0 100644 --- a/templates/admin/page/SiteSetting.php +++ b/templates/admin/page/SiteSetting.php @@ -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; }); diff --git a/templates/admin/page/home.php b/templates/admin/page/home.php index 2ee10db..0f7c58d 100644 --- a/templates/admin/page/home.php +++ b/templates/admin/page/home.php @@ -8,7 +8,7 @@ $data = empty($Notice)?[]:json_decode($Notice, true); //输出最新动态 function echo_notice_link($data){ - echo '
最新动态