From cd7cde2b4b3517d3a83befe578afc98c8aeb41a7 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Wed, 12 Aug 2020 09:59:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=B0=E5=BD=95=E6=9D=A5?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware/jwt.go | 2 +- static/js/gofly-front.js | 2 +- tmpl/login.go | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/middleware/jwt.go b/middleware/jwt.go index 1f5553d..e1c7c6f 100644 --- a/middleware/jwt.go +++ b/middleware/jwt.go @@ -26,7 +26,7 @@ func JwtApiMiddleware(c *gin.Context){ return } createTime:=int64(userinfo["create_time"].(float64)) - var expire int64=2*60*60 + var expire int64=24*60*60 nowTime:=time.Now().Unix(); if (nowTime-createTime) >=expire{ c.JSON(200, gin.H{ diff --git a/static/js/gofly-front.js b/static/js/gofly-front.js index 1a003df..4e6d9f8 100644 --- a/static/js/gofly-front.js +++ b/static/js/gofly-front.js @@ -9,7 +9,7 @@ $("#launchButton").click(function() { area: ['520px', '530px'], offset: 'rb', //右下角弹出 anim: 2, - content: [GOFLY_URL+'/chat_page', 'no'], //iframe的url,no代表不显示滚动条 + content: [GOFLY_URL+'/chat_page?refer='+window.location.host, 'no'], //iframe的url,no代表不显示滚动条 end: function(){ launchButtonFlag=false; $(".launchButton").show(); diff --git a/tmpl/login.go b/tmpl/login.go index 61b636b..ea78aa1 100644 --- a/tmpl/login.go +++ b/tmpl/login.go @@ -17,6 +17,9 @@ func PageChat(c *gin.Context) { lang,_ := c.Get("lang") language:=config.CreateLanguage(lang.(string)) refer:=c.Request.Referer() + if refer==""{ + refer = c.Query("refer") + } c.HTML(http.StatusOK, "chat_page.html", gin.H{ "KEFU_ID":kefuId, "SendBtn":language.Send,