|
@@ -42,23 +42,23 @@ const request = <T>(config:RequestConfig):Promise<ResponseData<T>> => {
|
|
|
// @ts-ignore
|
|
|
const msg:string = errorCode[code] || data.msg || errorCode['default']
|
|
|
if (code === 401) {
|
|
|
- // showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
|
|
- // if (res.confirm) {
|
|
|
- // store.dispatch('LogOut').then(res => {
|
|
|
- // uni.reLaunch({ url: '/pages/login' })
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
+ showConfirm('您还未登陆系统,是否前往登陆?').then(res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ store.dispatch('LogOut').then(res => {
|
|
|
+ uni.reLaunch({ url: '/pages/login' })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- uni.showToast({
|
|
|
- title: '登陆后可以享受更多的服务哦',
|
|
|
- icon: 'none',
|
|
|
- });
|
|
|
- setTimeout(() => {
|
|
|
- store.dispatch('LogOut').then(res => {
|
|
|
- uni.reLaunch({ url: '/pages/login' })
|
|
|
- })
|
|
|
- }, 500);
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '登陆后可以享受更多的服务哦',
|
|
|
+ // icon: 'none',
|
|
|
+ // });
|
|
|
+ // setTimeout(() => {
|
|
|
+ // store.dispatch('LogOut').then(res => {
|
|
|
+ // uni.reLaunch({ url: '/pages/login' })
|
|
|
+ // })
|
|
|
+ // }, 500);
|
|
|
|
|
|
reject('无效的会话,或者会话已过期,请重新登录。')
|
|
|
} else if (code === 500) {
|