增加密码错误的异常捕获和oa自动登录

This commit is contained in:
砂糖
2025-07-14 09:39:32 +08:00
parent 80688b3239
commit 94b3ded9fb
3 changed files with 174 additions and 200 deletions

View File

@@ -37,12 +37,12 @@ const request = config => {
data: config.data,
header: config.header,
dataType: 'json'
}).then(response => {
}).then(async response => {
let [error, res] = response
// 打印返回值
console.log('[oaRequest] 返回值:', res)
if (error) {
console.log(error)
console.log(error)
toast('后端接口连接异常')
reject('后端接口连接异常')
return
@@ -59,6 +59,12 @@ const request = config => {
try {
await getSMSCodeFromOa(phoneNumber)
await loginOaByPhone(phoneNumber)
const pages = getCurrentPages();
const page = pages[pages.length - 1];
// 重新加载当前页面
if (page && page.onLoad) {
page.onLoad(page.options || {});
}
} catch (e) {
console.log('OA自动登录失败', e)
toast('OA自动登录失败')
@@ -66,10 +72,6 @@ const request = config => {
} else {
toast('无法获取手机号OA自动登录失败')
}
// 登录
// store.dispatch('LogOut').then(res => {
// uni.reLaunch({ url: '/pages/login' })
// })
}
})
reject('无效的会话,或者会话已过期,请重新登录。')