|
|
|
@ -115,7 +115,6 @@ import { ElLoading } from 'element-plus' |
|
|
|
|
import { useIcon } from '@/hooks/web/useIcon' |
|
|
|
|
|
|
|
|
|
import * as authUtil from '@/utils/auth' |
|
|
|
|
import { usePermissionStore } from '@/store/modules/permission' |
|
|
|
|
import * as LoginApi from '@/api/login' |
|
|
|
|
import { LoginStateEnum, useFormValid, useLoginState } from './useLogin' |
|
|
|
|
|
|
|
|
@ -127,7 +126,6 @@ const formLogin = ref() |
|
|
|
|
const { validForm } = useFormValid(formLogin) |
|
|
|
|
const { setLoginState, getLoginState } = useLoginState() |
|
|
|
|
const { currentRoute, push } = useRouter() |
|
|
|
|
const permissionStore = usePermissionStore() |
|
|
|
|
const redirect = ref('') |
|
|
|
|
const loginLoading = ref(false) |
|
|
|
|
const verify = ref() |
|
|
|
@ -217,7 +215,7 @@ const handleLogin = async (params) => { |
|
|
|
|
if (redirect.value.indexOf('sso') !== -1) { |
|
|
|
|
window.location.href = window.location.href.replace('/login?redirect=', '') |
|
|
|
|
} else { |
|
|
|
|
push({ path: redirect.value || permissionStore.addRouters[0].path }) |
|
|
|
|
push({ path: redirect.value || '/index' }) |
|
|
|
|
} |
|
|
|
|
} catch { |
|
|
|
|
loginLoading.value = false |
|
|
|
|