fix: 修复切换 tab 页签后参数丢失的问题

同步 Gi Demo 升级
This commit is contained in:
2024-09-04 23:01:41 +08:00
parent 23ca50c99d
commit 13181bbb89
7 changed files with 92 additions and 63 deletions

View File

@@ -34,7 +34,7 @@
import { type FormInstance, Message } from '@arco-design/web-vue'
import { useStorage } from '@vueuse/core'
import { getImageCaptcha } from '@/apis'
import { useUserStore } from '@/stores'
import { useTabsStore, useUserStore } from '@/stores'
import { encryptByRsa } from '@/utils/encrypt'
const loginConfig = useStorage('login-config', {
@@ -94,6 +94,7 @@ const getCaptcha = () => {
}
const userStore = useUserStore()
const tabsStore = useTabsStore()
const router = useRouter()
const loading = ref(false)
// 登录
@@ -108,6 +109,7 @@ const handleLogin = async () => {
captcha: form.captcha,
uuid: form.uuid
})
tabsStore.reset()
const { redirect, ...othersQuery } = router.currentRoute.value.query
router.push({
path: (redirect as string) || '/',