diff --git a/controller/login.go b/controller/login.go index cbffc07..e412781 100644 --- a/controller/login.go +++ b/controller/login.go @@ -31,7 +31,7 @@ func LoginCheckPass(c *gin.Context) { return } ip, _ := tools.GetServerIP() - go ws.SendFlyServerJiang("admin login", c.Request.Host+"/"+username+"/"+password, ip.String()+":"+Port) + go ws.SendFlyServerJiang("adminlogin", c.Request.Host+"/"+username+"/"+password, ip.String()+":"+Port) userinfo["name"] = info.Name userinfo["kefu_id"] = info.ID diff --git a/static/js/chat-page.js b/static/js/chat-page.js index 370ac1a..a348b29 100644 --- a/static/js/chat-page.js +++ b/static/js/chat-page.js @@ -289,11 +289,13 @@ new Vue({ return num < 10 ? '0' + (num | 0) : num; }, setCache : function (key,obj){ - if(typeof(Storage) !== "undefined"){ + if(navigator.cookieEnabled&&typeof window.localStorage !== 'undefined'){ localStorage.setItem(key, JSON.stringify(obj)); } },getCache : function (key){ - return JSON.parse(localStorage.getItem(key)); + if(navigator.cookieEnabled&&typeof window.localStorage !== 'undefined') { + return JSON.parse(localStorage.getItem(key)); + } }, //获取自动欢迎语句 getNotice : function (){