Browse Source

20220527

pull/81/head
xiaoz 2 years ago
parent
commit
652c1c6e08
  1. 2
      README.md
  2. 4
      class/Api.php
  3. 3
      data/update.log
  4. 7
      templates/admin/index.php
  5. 37
      templates/admin/setting/subscribe.php

2
README.md

@ -60,7 +60,7 @@ docker run -itd --name="onenav" -p 80:80 \
## 联系我 ## 联系我
* Blog:https://www.xiaoz.me/ * Blog:https://www.xiaoz.me/
* QQ:337003006 * QQ:446199062
* QQ群:147687134 * QQ群:147687134
* 社区支持:[https://dwz.ovh/vd0bw](https://dwz.ovh/vd0bw) * 社区支持:[https://dwz.ovh/vd0bw](https://dwz.ovh/vd0bw)

4
class/Api.php

@ -1442,7 +1442,7 @@ class Api {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
#设置超时时间,最小为1s(可选) #设置超时时间,最小为1s(可选)
curl_setopt($curl , CURLOPT_TIMEOUT, 5); curl_setopt($curl , CURLOPT_TIMEOUT, 30);
$html = curl_exec($curl); $html = curl_exec($curl);
curl_close($curl); curl_close($curl);
@ -1459,7 +1459,7 @@ class Api {
$this->return_json(-2000,'',$data->msg); $this->return_json(-2000,'',$data->msg);
} }
else{ else{
$this->return_json(-2000,'',"请求接口失败!"); $this->return_json(-2000,'',"请求接口失败,请重试!");
} }
} catch (\Throwable $th) { } catch (\Throwable $th) {
$this->return_json(-2000,'','网络请求失败!'); $this->return_json(-2000,'','网络请求失败!');

3
data/update.log

@ -121,6 +121,7 @@ CREATE INDEX on_options_key_IDX ON on_options ("key");
20220525 20220525
1. 修复link_list和get_a_link可以查询私有分类下的公有链接问题 1. 修复link_list和get_a_link可以查询私有分类下的公有链接问题
2. 新增查询指定分类下的链接接口:q_category_link 2. 新增查询指定分类下的链接接口:q_category_link
3. 新增主题删除功能
20220527 20220527
1. 新增订阅在线更新 1. 新增订阅在线更新

7
templates/admin/index.php

@ -13,7 +13,10 @@
</div> </div>
</div> </div>
<div class="layui-col-lg4"> <div class="layui-col-lg4">
<div class = "admin-msg">最新版本:<span><span id = "getting">获取中...</span><a href = "https://github.com/helloxz/onenav/releases" title = "下载最新版OneNav" target = "_blank" id="latest_version"></a></span></div> <div class = "admin-msg">
最新版本:<span><span id = "getting">获取中...</span><a href = "https://github.com/helloxz/onenav/releases" title = "下载最新版OneNav" target = "_blank" id="latest_version"></a></span>
(<a href="/index.php?c=admin&page=setting/subscribe" title = "订阅后可一键更新">一键更新</a>)
</div>
</div> </div>
<div class="layui-col-lg4"> <div class="layui-col-lg4">
<div class = "admin-msg">QQ群1:147687134</div> <div class = "admin-msg">QQ群1:147687134</div>
@ -31,7 +34,7 @@
<div class = "admin-msg">帮助文档:<a href="https://dwz.ovh/onenav" rel = "nofollow" target="_blank">https://dwz.ovh/onenav</a></div> <div class = "admin-msg">帮助文档:<a href="https://dwz.ovh/onenav" rel = "nofollow" target="_blank">https://dwz.ovh/onenav</a></div>
</div> </div>
<div class="layui-col-lg4"> <div class="layui-col-lg4">
<div class = "admin-msg">QQ:337003006</div> <div class = "admin-msg">QQ:446199062</div>
</div> </div>
<div class="layui-col-lg4"> <div class="layui-col-lg4">
<div class = "admin-msg">Blog: <a href="https://www.xiaoz.me/" rel = "nofollow" target="_blank">https://www.xiaoz.me/</a></div> <div class = "admin-msg">Blog: <a href="https://www.xiaoz.me/" rel = "nofollow" target="_blank">https://www.xiaoz.me/</a></div>

37
templates/admin/setting/subscribe.php

@ -11,15 +11,17 @@
<ol> <ol>
<li>您可以前往:<a href="https://dwz.ovh/69h9q" rel = "nofollow" target = "_blank" title = "购买订阅服务">https://dwz.ovh/69h9q</a> 购买订阅服务,订阅后可以:</li> <li>您可以前往:<a href="https://dwz.ovh/69h9q" rel = "nofollow" target = "_blank" title = "购买订阅服务">https://dwz.ovh/69h9q</a> 购买订阅服务,订阅后可以:</li>
<li>1. 享受一键更新OneNav</li> <li>1. 享受一键更新OneNav</li>
<li>2. 可在线更新和下载主题(尚未实现)</li> <li>2. 可在线更新和下载主题(实现中...</li>
<li>3. 可享受一对一售后服务</li> <li>3. 可享受一对一售后服务</li>
<li>4. 可帮助OneNav持续发展,让OneNav变得更加美好</li> <li>4. 可帮助OneNav持续发展,让OneNav变得更加美好</li>
<li>5. 更多高级功能(实现中...)</li>
</ol> </ol>
</div> </div>
</div> </div>
<!-- 说明提示框END --> <!-- 说明提示框END -->
<!-- 订阅表格 --> <!-- 订阅表格 -->
<div class="layui-col-lg6"> <div class="layui-col-lg6">
<h2 style = "margin-bottom:1em;">我的订阅:</h2>
<form class="layui-form layui-form-pane" action=""> <form class="layui-form layui-form-pane" action="">
<div class="layui-form-item"> <div class="layui-form-item">
@ -120,7 +122,7 @@
$.get("/index.php?c=api&method=check_subscribe",function(data,status){ $.get("/index.php?c=api&method=check_subscribe",function(data,status){
update_status("10%","正在验证订阅信息..."); update_status("10%","正在验证订阅信息...");
if( data.code == 200 ) { if( data.code == 200 ) {
update_status("20%","订阅信息验证通过..."); update_status("30%","订阅信息验证通过...");
//取得必要的变量 //取得必要的变量
var email = data.data.email; var email = data.data.email;
var domain = data.data.domain; var domain = data.data.domain;
@ -128,37 +130,41 @@
var value = data.data.value; var value = data.data.value;
//下载更新程序 //下载更新程序
$.get("/index.php?c=api&method=up_updater",function(data,status) { $.get("/index.php?c=api&method=up_updater",function(data,status) {
update_status("30%","正在检查更新程序..."); update_status("50%","正在检查更新程序...");
if( data.code == 200 ) { if( data.code == 200 ) {
//继续往下执行 //继续往下执行
update_status("40%","更新程序准备完成..."); update_status("70%","更新程序准备完成...");
//准备下载升级包 //准备下载升级包
update_status("50%","准备下载升级包..."); update_status("80%","准备下载升级包...");
$.get("/update.php",{version:new_version,key:key,value:value,type:'main'},function(data,stauts){ $.get("/update.php",{version:new_version,key:key,value:value,type:'main'},function(data,stauts){
update_status("70%","升级包下载完毕,正在校验版本..."); update_status("90%","升级包下载完毕,正在校验版本...");
if( data.code == 200 ) { if( data.code == 200 ) {
//校验新版本 //校验新版本
$.get("/index.php?c=api&method=check_version",{version:new_version},function(data,status){ $.get("/index.php?c=api&method=check_version",{version:new_version},function(data,status){
if(data.code == 200) { if(data.code == 200) {
update_status("100%","更新完成!"); update_status("100%","更新完成,请前往后台检查<a href = '/index.php?c=admin'>更新数据库</a>!");
} }
else { else {
layer.msg(data.msg,{icon:5,time: 0}); update_error(data.msg);
//layer.msg(data.msg,{icon:5,time: 0});
} }
}); });
} }
else{ else{
layer.msg(data.msg,{icon:5,time: 0}); update_error(data.msg);
//layer.msg(data.msg,{icon:5,time: 0});
} }
}); });
} }
else { else {
layer.msg(data.msg,{icon:5,time: 0}); update_error(data.msg);
//layer.msg(data.msg,{icon:5,time: 0});
} }
}); });
} }
else{ else{
layer.msg(data.msg,{icon:5,time: 0}); update_error(data.msg);
//layer.msg(data.msg,{icon:5,time: 0});
} }
}); });
} }
@ -173,4 +179,13 @@
}); });
} }
//更新失败时的提示
function update_error(msg) {
layer.open({
title: '更新失败:'
,content: msg
,icon:5
});
$("#progress").hide();
}
</script> </script>
Loading…
Cancel
Save