| | |
| | | defineOptions({ name: 'LoginForm' }) |
| | | |
| | | const { t } = useI18n() |
| | | const message = useMessage() |
| | | const iconHouse = useIcon({ icon: 'ep:house' }) |
| | | const iconAvatar = useIcon({ icon: 'ep:avatar' }) |
| | | const iconLock = useIcon({ icon: 'ep:lock' }) |
| | | const formLogin = ref() |
| | | const { validForm } = useFormValid(formLogin) |
| | | const { setLoginState, getLoginState } = useLoginState() |
| | | const { getLoginState } = useLoginState() |
| | | const { currentRoute, push } = useRouter() |
| | | const permissionStore = usePermissionStore() |
| | | const redirect = ref<string>('') |
| | |
| | | } |
| | | authUtil.setToken(res) |
| | | if (!redirect.value) { |
| | | redirect.value = '/' |
| | | redirect.value = '/index' |
| | | } |
| | | let tenantId = authUtil.getTenantId() |
| | | // if(tenantId != 1) { |
| | | // //只要不是系统租户,登录成功跳转到home2页面 |
| | | // window.location.href = '/home2' |
| | | // } else { |
| | | // 判断是否为SSO登录 |
| | | if (redirect.value.indexOf('sso') !== -1) { |
| | | window.location.href = window.location.href.replace('/login?redirect=', '') |
| | | } else { |
| | | push({ path: redirect.value || permissionStore.addRouters[0].path }) |
| | | } |
| | | // } |
| | | // 判断是否为SSO登录 |
| | | if (redirect.value.indexOf('sso') !== -1) { |
| | | window.location.href = window.location.href.replace('/login?redirect=', '') |
| | | } else { |
| | | push({ path: redirect.value || permissionStore.addRouters[0].path }) |
| | | } |
| | | } finally { |
| | | loginLoading.value = false |
| | | loading.value.close() |