修改
This commit is contained in:
parent
941675105b
commit
b565eb744e
@ -6,3 +6,10 @@ export function getWeChatUser(loginCode,phoneCode) {
|
|||||||
method: 'GET'
|
method: 'GET'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function createMobileToken() {
|
||||||
|
return request({
|
||||||
|
url: `/nurseApplet/authorization/createMobileToken`,
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -10,10 +10,26 @@ var request = function(config) {
|
|||||||
data: config.data,
|
data: config.data,
|
||||||
method: config.method,
|
method: config.method,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
// header: {
|
header: {
|
||||||
// token: uni.getStorageSync('token')
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
// },
|
},
|
||||||
success(res) {
|
success(res) {
|
||||||
|
if (res.data.code == 9999) {
|
||||||
|
uni.removeStorageSync('token');
|
||||||
|
let pages = getCurrentPages();
|
||||||
|
let path = pages[pages.length - 1].$page.fullPath
|
||||||
|
if (path == '/pages/user/user') {
|
||||||
|
setTimeout(e => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
}, 200);
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user