This commit is contained in:
ygx
2026-03-08 22:41:42 +08:00
parent f7bbb5ee46
commit 180d980514
23 changed files with 1392 additions and 850 deletions

View File

@@ -46,7 +46,7 @@
<script lang="ts" setup>
import type { LoginData } from '@/api/types'
import useLoading from '@/hooks/loading'
import { useUserStore } from '@/store'
import { useUserStore, useAppStore } from '@/store'
import { Message } from '@arco-design/web-vue'
import { ValidatedError } from '@arco-design/web-vue/es/form/interface'
import { useStorage } from '@vueuse/core'
@@ -59,6 +59,7 @@ const { t } = useI18n()
const errorMessage = ref('')
const { loading, setLoading } = useLoading()
const userStore = useUserStore()
const appStore = useAppStore()
const loginConfig = useStorage('login-config', {
rememberPassword: true,
@@ -76,12 +77,10 @@ const handleSubmit = async ({ errors, values }: { errors: Record<string, Validat
setLoading(true)
try {
await userStore.login(values as LoginData)
await appStore.fetchServerMenuConfig()
const { redirect, ...othersQuery } = router.currentRoute.value.query
router.push({
name: (redirect as string) || 'Workplace',
query: {
...othersQuery,
},
path: '/overview'
})
Message.success(t('login.form.login.success'))
const { rememberPassword } = loginConfig.value