From e3a208eee363fece03e39625c9d677869ec44b3b Mon Sep 17 00:00:00 2001 From: yuanadmin Date: Fri, 30 Sep 2022 18:00:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9getStatus=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E9=97=B4=E9=9A=94=EF=BC=8C=E9=81=BF=E5=85=8D=E8=BF=87?= =?UTF-8?q?=E4=BA=8E=E9=A2=91=E7=B9=81=E7=9A=84=E8=AF=B7=E6=B1=82=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=202.=20=E9=80=9A=E8=BF=87=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3=E5=8F=96=E4=BB=A3=E7=89=88=E6=9C=AC=E5=8F=B7=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=B5=8F=E8=A7=88=E5=99=A8=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84js=E6=96=87=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=97=A0=E6=B3=95=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=203.=20=E5=A2=9E=E5=8A=A0=E7=99=BB=E5=BD=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=A3=80=E6=9F=A5=E5=8A=9F=E8=83=BD=EF=BC=9A=20?= =?UTF-8?q?=E4=B8=80=E6=97=A6=E7=99=BB=E5=BD=95=E5=A4=B1=E6=95=88=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=87=8D=E5=AE=9A=E5=90=91=E5=88=B0=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/assets/js/util/utils.js | 6 ++++++ web/controller/util.go | 4 +++- web/html/common/js.html | 13 +++++++------ web/html/xui/index.html | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/web/assets/js/util/utils.js b/web/assets/js/util/utils.js index 6b4e5ed942..2a35d9e991 100644 --- a/web/assets/js/util/utils.js +++ b/web/assets/js/util/utils.js @@ -10,6 +10,12 @@ class HttpUtil { Vue.prototype.$message.success(msg.msg); } else { Vue.prototype.$message.error(msg.msg); + if (msg.msg == '登录时效已过,请重新登录') { + setTimeout(()=> { + Vue.prototype.$message.warning("即将开始重新登录!") + setTimeout(()=> {window.location.reload()},3000) + },2000) + } } } diff --git a/web/controller/util.go b/web/controller/util.go index 0b214fdc9a..94e1e951fe 100644 --- a/web/controller/util.go +++ b/web/controller/util.go @@ -5,6 +5,7 @@ import ( "net" "net/http" "strings" + "time" "x-ui/config" "x-ui/logger" "x-ui/web/entity" @@ -82,7 +83,8 @@ func html(c *gin.Context, name string, title string, data gin.H) { func getContext(h gin.H) gin.H { a := gin.H{ - "cur_ver": config.GetVersion(), + "cur_ver": config.GetVersion(), + "timeStamp": time.Now().Unix(), } if h != nil { for key, value := range h { diff --git a/web/html/common/js.html b/web/html/common/js.html index b8ee57b2f8..d227f362cd 100644 --- a/web/html/common/js.html +++ b/web/html/common/js.html @@ -8,12 +8,13 @@ - - - - - - + + + + + + +