|
@@ -147,9 +147,9 @@
|
|
|
import { ElLoading } from 'element-plus'
|
|
|
import LoginFormTitle from './LoginFormTitle.vue'
|
|
|
import type { RouteLocationNormalizedLoaded } from 'vue-router'
|
|
|
-import SHome from '@/views/system/Home/Index.vue'
|
|
|
+
|
|
|
import { useIcon } from '@/hooks/web/useIcon'
|
|
|
-import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
|
|
|
+
|
|
|
import * as authUtil from '@/utils/auth'
|
|
|
import { usePermissionStore } from '@/store/modules/permission'
|
|
|
import * as LoginApi from '@/api/login'
|
|
@@ -239,7 +239,6 @@ const getTenantByWebsite = async () => {
|
|
|
authUtil.setTenantId(res.id)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
const loading = ref() // ElLoading.service 返回的实例
|
|
|
// 登录
|
|
|
const handleLogin = async (params) => {
|
|
@@ -253,7 +252,6 @@ const handleLogin = async (params) => {
|
|
|
const loginDataLoginForm = { ...loginData.loginForm }
|
|
|
loginDataLoginForm.captchaVerification = params.captchaVerification
|
|
|
const res = await LoginApi.login(loginDataLoginForm)
|
|
|
-
|
|
|
if (!res) {
|
|
|
return
|
|
|
}
|
|
@@ -268,10 +266,9 @@ const handleLogin = async (params) => {
|
|
|
authUtil.removeLoginForm()
|
|
|
}
|
|
|
authUtil.setToken(res)
|
|
|
-
|
|
|
if (!redirect.value) {
|
|
|
redirect.value = '/'
|
|
|
- }
|
|
|
+ }
|
|
|
// 判断是否为SSO登录
|
|
|
if (redirect.value.indexOf('sso') !== -1) {
|
|
|
window.location.href = window.location.href.replace('/login?redirect=', '')
|
|
@@ -332,7 +329,6 @@ watch(
|
|
|
onMounted(() => {
|
|
|
getLoginFormCache()
|
|
|
getTenantByWebsite()
|
|
|
-
|
|
|
})
|
|
|
</script>
|
|
|
|