mirror of
https://github.com/yangzongzhuan/RuoYi-App.git
synced 2025-09-27 22:52:40 +00:00
update vue3
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import store from '@/store'
|
import { useUserStore } from '@/store'
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import errorCode from '@/utils/errorCode'
|
import errorCode from '@/utils/errorCode'
|
||||||
@@ -35,7 +35,7 @@ const request = config => {
|
|||||||
if (code === 401) {
|
if (code === 401) {
|
||||||
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
store.dispatch('LogOut').then(res => {
|
useUserStore().logOut().then(res => {
|
||||||
uni.reLaunch({ url: '/pages/login' })
|
uni.reLaunch({ url: '/pages/login' })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import store from '@/store'
|
import { useUserStore } from '@/store'
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import errorCode from '@/utils/errorCode'
|
import errorCode from '@/utils/errorCode'
|
||||||
@@ -37,7 +37,7 @@ export default function upload(config) {
|
|||||||
} else if (code == 401) {
|
} else if (code == 401) {
|
||||||
showConfirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then(res => {
|
showConfirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then(res => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
store.dispatch('LogOut').then(res => {
|
useUserStore().logOut().then(res => {
|
||||||
uni.reLaunch({ url: '/pages/login/login' })
|
uni.reLaunch({ url: '/pages/login/login' })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user