You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
524 B
24 lines
524 B
import Vue from 'vue';
|
|
|
|
const Api = new function(){
|
|
// 检测登录
|
|
this.checkLogin = function(){
|
|
let token = Vue.prototype.$storage.get("token")||'';
|
|
//console.log("当前token的值"+token);
|
|
if(!token){
|
|
console.log("未检测到token");
|
|
uni.redirectTo({
|
|
url: '/pages/login/login-index'
|
|
}).then(data =>{
|
|
uni.showToast({
|
|
icon: 'none',
|
|
title: '账号已过期,请重新登录!'
|
|
});
|
|
})
|
|
}else{
|
|
this.token =token
|
|
}
|
|
}
|
|
}
|
|
export default Api
|
|
|