This commit is contained in:
曹辉 2022-12-27 09:22:53 +08:00
parent 941675105b
commit b565eb744e
2 changed files with 28 additions and 5 deletions

View File

@ -6,3 +6,10 @@ export function getWeChatUser(loginCode,phoneCode) {
method: 'GET' method: 'GET'
}) })
} }
export function createMobileToken() {
return request({
url: `/nurseApplet/authorization/createMobileToken`,
method: 'GET'
})
}

View File

@ -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)
}, },