修改登录
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
const Cache = {
|
||||
//设置缓存(expire为缓存时效)
|
||||
set(key, value, expire) {
|
||||
|
||||
let data = {
|
||||
expire: expire ? (this.time() + expire) : "",
|
||||
value
|
||||
|
||||
@ -32,6 +32,7 @@ export function getWxCode() {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//小程序获取用户信息
|
||||
export function getUserProfile() {
|
||||
return new Promise((resolve, reject) => {
|
||||
@ -43,7 +44,18 @@ export function getUserProfile() {
|
||||
fail(res) {}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
//通用小程序获取用户信息
|
||||
export function getUserInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getUserInfo({
|
||||
success: (res) => {
|
||||
resolve(res);
|
||||
},
|
||||
fail(res) {}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export const wxMnpLogin = trottle(_wxMnpLogin, 1000)
|
||||
|
||||
@ -83,10 +83,7 @@ service.interceptors.response.use(
|
||||
wxMnpLogin();
|
||||
// #endif
|
||||
//#ifdef H5 || APP-PLUS
|
||||
console.log('route=', route)
|
||||
console.log('tabbarList=', tabbarList)
|
||||
if (route && !tabbarList.includes(route)) {
|
||||
console.log(1213)
|
||||
toLogin();
|
||||
}
|
||||
// #endif
|
||||
|
||||
Reference in New Issue
Block a user