mirror of
https://gitee.com/wangkang/udf.git
synced 2026-11-02 13:33:42 +00:00
更新
This commit is contained in:
+4
-2
@@ -123,6 +123,10 @@
|
||||
//初始化
|
||||
this.init();
|
||||
},
|
||||
mounted() {
|
||||
//检查登陆
|
||||
glob.checkLogin();
|
||||
},
|
||||
methods: {
|
||||
//初始化
|
||||
init() {
|
||||
@@ -137,8 +141,6 @@
|
||||
window.addEventListener('resize', this.resizeListener);
|
||||
//主动调用一次resize监听
|
||||
this.resizeListener();
|
||||
//检查登陆
|
||||
glob.checkLogin();
|
||||
},
|
||||
//重设主题属性
|
||||
resetTheme() {
|
||||
|
||||
@@ -9,21 +9,12 @@ const glob = {
|
||||
//初始化Axios
|
||||
this.intiAxios();
|
||||
},
|
||||
//读取cookies
|
||||
getCookie(name) {
|
||||
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
|
||||
if (arr === document.cookie.match(reg)) {
|
||||
return unescape(arr[2]);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
//返回token
|
||||
getToken() {
|
||||
//token名称
|
||||
const TOKEN_NAME = 'token';
|
||||
//返回TOKEN
|
||||
return this.getCookie(this.TOKEN_NAME);
|
||||
return $cookies.get(this.TOKEN_NAME);
|
||||
},
|
||||
//检查是否登陆
|
||||
checkLogin() {
|
||||
|
||||
Reference in New Issue
Block a user