psj 2 years ago
parent
commit
991ff858ca
1 changed files with 17 additions and 0 deletions
  1. 17 0
      src/commomUse.js

+ 17 - 0
src/commomUse.js

@@ -156,3 +156,20 @@ export function getParenthesesStr(text) {
     }
     return result
 }
+
+
+
+/**清空缓存并退出*/
+export function userExit(obj) {
+    //localStorage.clear(); //清除登录信息
+    localStorage.setItem("ywtb_usercode", "");
+    localStorage.setItem("ywtb_username", "");
+    localStorage.setItem("ywtb_unitcode", "");
+    localStorage.setItem("ywtb_unitname", "");
+    localStorage.setItem("ywtb_password", "");
+    localStorage.setItem("ywtb_lasttime", "");
+    localStorage.setItem("ywtb_role", "");
+    localStorage.setItem("ywtb_userkeycode", "");
+    localStorage.setItem("tempConfigButtonMap", "");
+    obj.$router.push('/login');
+}