From 652c1c6e08284881ba83488e1f301799235bcce2 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Fri, 27 May 2022 16:56:12 +0800 Subject: [PATCH] 20220527 --- README.md | 2 +- class/Api.php | 4 +-- data/update.log | 3 ++- templates/admin/index.php | 7 +++-- templates/admin/setting/subscribe.php | 37 +++++++++++++++++++-------- 5 files changed, 36 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index d340027..e4a9373 100755 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ docker run -itd --name="onenav" -p 80:80 \ ## 联系我 * Blog:https://www.xiaoz.me/ -* QQ:337003006 +* QQ:446199062 * QQ群:147687134 * 社区支持:[https://dwz.ovh/vd0bw](https://dwz.ovh/vd0bw) diff --git a/class/Api.php b/class/Api.php index 281ed91..ddb8b14 100755 --- a/class/Api.php +++ b/class/Api.php @@ -1442,7 +1442,7 @@ class Api { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); #设置超时时间,最小为1s(可选) - curl_setopt($curl , CURLOPT_TIMEOUT, 5); + curl_setopt($curl , CURLOPT_TIMEOUT, 30); $html = curl_exec($curl); curl_close($curl); @@ -1459,7 +1459,7 @@ class Api { $this->return_json(-2000,'',$data->msg); } else{ - $this->return_json(-2000,'',"请求接口失败!"); + $this->return_json(-2000,'',"请求接口失败,请重试!"); } } catch (\Throwable $th) { $this->return_json(-2000,'','网络请求失败!'); diff --git a/data/update.log b/data/update.log index 33f1354..10a7bb2 100755 --- a/data/update.log +++ b/data/update.log @@ -121,6 +121,7 @@ CREATE INDEX on_options_key_IDX ON on_options ("key"); 20220525 1. 修复link_list和get_a_link可以查询私有分类下的公有链接问题 2. 新增查询指定分类下的链接接口:q_category_link +3. 新增主题删除功能 20220527 -1. 新增订阅于在线更新 \ No newline at end of file +1. 新增订阅后在线更新 \ No newline at end of file diff --git a/templates/admin/index.php b/templates/admin/index.php index c6240d6..a607ad3 100755 --- a/templates/admin/index.php +++ b/templates/admin/index.php @@ -13,7 +13,10 @@
-
最新版本:获取中...
+
+ 最新版本:获取中... + (一键更新) +
QQ群1:147687134
@@ -31,7 +34,7 @@
帮助文档:https://dwz.ovh/onenav
-
QQ:337003006
+
QQ:446199062
diff --git a/templates/admin/setting/subscribe.php b/templates/admin/setting/subscribe.php index 43988d5..1ceaa06 100644 --- a/templates/admin/setting/subscribe.php +++ b/templates/admin/setting/subscribe.php @@ -11,15 +11,17 @@
  1. 您可以前往:https://dwz.ovh/69h9q 购买订阅服务,订阅后可以:
  2. 1. 享受一键更新OneNav
  3. -
  4. 2. 可在线更新和下载主题(尚未实现)
  5. +
  6. 2. 可在线更新和下载主题(实现中...)
  7. 3. 可享受一对一售后服务
  8. 4. 可帮助OneNav持续发展,让OneNav变得更加美好
  9. +
  10. 5. 更多高级功能(实现中...)
+

我的订阅:

@@ -120,7 +122,7 @@ $.get("/index.php?c=api&method=check_subscribe",function(data,status){ update_status("10%","正在验证订阅信息..."); if( data.code == 200 ) { - update_status("20%","订阅信息验证通过..."); + update_status("30%","订阅信息验证通过..."); //取得必要的变量 var email = data.data.email; var domain = data.data.domain; @@ -128,37 +130,41 @@ var value = data.data.value; //下载更新程序 $.get("/index.php?c=api&method=up_updater",function(data,status) { - update_status("30%","正在检查更新程序..."); + update_status("50%","正在检查更新程序..."); 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){ - update_status("70%","升级包下载完毕,正在校验版本..."); + update_status("90%","升级包下载完毕,正在校验版本..."); if( data.code == 200 ) { //校验新版本 $.get("/index.php?c=api&method=check_version",{version:new_version},function(data,status){ if(data.code == 200) { - update_status("100%","更新完成!"); + update_status("100%","更新完成,请前往后台检查更新数据库!"); } else { - layer.msg(data.msg,{icon:5,time: 0}); + update_error(data.msg); + //layer.msg(data.msg,{icon:5,time: 0}); } }); } else{ - layer.msg(data.msg,{icon:5,time: 0}); + update_error(data.msg); + //layer.msg(data.msg,{icon:5,time: 0}); } }); } else { - layer.msg(data.msg,{icon:5,time: 0}); + update_error(data.msg); + //layer.msg(data.msg,{icon:5,time: 0}); } }); } 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(); + } \ No newline at end of file