施工页面样式修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { getToken } from './auth'
|
||||
import errorCode from './errorCode'
|
||||
import { toast, showConfirm, tansParams } from './common'
|
||||
import { getSMSCodeFromOa, loginOaByPhone } from '../api/oa/login'
|
||||
|
||||
let timeout = 10000
|
||||
const baseUrl = 'http://110.41.139.73:8080'
|
||||
@@ -42,8 +43,23 @@ const request = config => {
|
||||
const code = res.data.code || 200
|
||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||
if (code === 401) {
|
||||
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
||||
showConfirm('登录状态已过期,是否刷新登录状态').then(async res => {
|
||||
if (res.confirm) {
|
||||
// 从store中获取phoneNumber,并依次调用getSMSCodeFromOa和loginOaByPhone
|
||||
const store = require('@/store').default
|
||||
const phoneNumber = store.getters.storeSelfInfo?.phoneNumber
|
||||
if (phoneNumber) {
|
||||
try {
|
||||
await getSMSCodeFromOa(phoneNumber)
|
||||
await loginOaByPhone(phoneNumber)
|
||||
} catch (e) {
|
||||
console.log('OA自动登录失败', e)
|
||||
toast('OA自动登录失败')
|
||||
}
|
||||
} else {
|
||||
toast('无法获取手机号,OA自动登录失败')
|
||||
}
|
||||
// 登录
|
||||
// store.dispatch('LogOut').then(res => {
|
||||
// uni.reLaunch({ url: '/pages/login' })
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user