Commit 10cd880f authored by zhangyanni's avatar zhangyanni

提交退出登录

parent 3c86cabc
......@@ -41,7 +41,7 @@ export default {
i18n,
isToWhich(data){
// publicFunc.clearCookie();
if(data!=998) this.publicFun.delCookie();
if(data!=998) publicFun.delCookie();
isMobile? router.replace("/mobileLogin") :router.replace("/login");
},
......@@ -89,7 +89,7 @@ export default {
}
else if(data==998||data==996){
if(data==998&&publicFun.getUserInfoCookieType()){
this.publicFun.removeCookieType();
publicFun.removeCookieType();
}
window.sessionStorage.setItem("errorMsg",response.data.msg);
if(isMobile){
......
......@@ -192,10 +192,10 @@ export default {
//清除所有cookie
// ***谨慎使用 涉及到用户唯一id标识
delCookie() {
var keys = document.cookie.match(/[^ =;]+(?==)/g), language, type = navigator.appName,that = this;
var keys = document.cookie.match(/[^ =;]+(?==)/g), language, type = navigator.appName,that = this,userValue = that.judgeBrand()+"userInfo";
if (keys) {
for (var i = keys.length; i--;) {
if(keys[i]==that.judgeBrand()+"userInfo"){
if(keys[i]==userValue){
}else{
document.cookie = keys[i] + '=0;path=/;expires=' + new Date(0).toUTCString() // 清除当前域名下的,例如:m.ratingdog.cn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment