Skip to content

Commit

Permalink
ci(deps): fix 线上环境刷新页面白屏 退出登录时逻辑优化 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
zane0904 committed Sep 19, 2022
1 parent 41d07a3 commit 9c136da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/http/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ export class VAxios {
type: 'error',
})
const router = routeStore()
await router.reset(() => {
await router.reset(async () => {
const go = useGo()
go('/login')
await go('/login')
})
return Promise.reject(error)
} else if (axios.isCancel(error)) {
Expand Down
6 changes: 3 additions & 3 deletions src/pinia/modules/routeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const routeStore = defineStore({
}),
actions: {
reset(callBack: () => void = () => {}) {
return new Promise((resolve) => {
return new Promise(async (resolve) => {
const user = useProfileStore()
removeRoute()
user.$reset()
await callBack()
setTimeout(() => {
user.$reset()
resolve(true)
callBack()
this.$reset()
}, 100)
})
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default ({ command, mode }: ConfigEnv) => {
define: {
__APP_INFO__: JSON.stringify(APP_INFO),
},
base: './',
base: '/',
server: {
open: VITE_APP_OPEN,
host: true,
Expand Down

0 comments on commit 9c136da

Please sign in to comment.