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,