-
diff --git a/src/service/api/auth.ts b/src/service/api/auth.ts
index 2ef50b66..27e49b69 100644
--- a/src/service/api/auth.ts
+++ b/src/service/api/auth.ts
@@ -1,13 +1,5 @@
import { request } from '../request';
-/** Get tenant list */
-export function fetchTenantList() {
- return request
({
- url: '/auth/tenant/list',
- method: 'get'
- });
-}
-
/** Get image code */
export function fetchCaptchaCode() {
return request({
diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts
index 94ecd762..994524ba 100644
--- a/src/typings/components.d.ts
+++ b/src/typings/components.d.ts
@@ -51,11 +51,17 @@ declare module 'vue' {
IconMaterialSymbolsUploadRounded: typeof import('~icons/material-symbols/upload-rounded')['default']
IconMaterialSymbolsWarningOutlineRounded: typeof import('~icons/material-symbols/warning-outline-rounded')['default']
IconMdiArrowDownThin: typeof import('~icons/mdi/arrow-down-thin')['default']
+ IconMdiArrowRightThick: typeof import('~icons/mdi/arrow-right-thick')['default']
IconMdiArrowUpThin: typeof import('~icons/mdi/arrow-up-thin')['default']
+ IconMdiCheckCircleOutline: typeof import('~icons/mdi/check-circle-outline')['default']
IconMdiDrag: typeof import('~icons/mdi/drag')['default']
IconMdiGithub: typeof import('~icons/mdi/github')['default']
IconMdiKeyboardEsc: typeof import('~icons/mdi/keyboard-esc')['default']
IconMdiKeyboardReturn: typeof import('~icons/mdi/keyboard-return')['default']
+ IconMdiLoading: typeof import('~icons/mdi/loading')['default']
+ IconMdiRefresh: typeof import('~icons/mdi/refresh')['default']
+ IconMdiShieldAlertOutline: typeof import('~icons/mdi/shield-alert-outline')['default']
+ IconMdiShieldCheckOutline: typeof import('~icons/mdi/shield-check-outline')['default']
IconOcticonPin16: typeof import('~icons/octicon/pin16')['default']
IconOcticonPinSlash16: typeof import('~icons/octicon/pin-slash16')['default']
IconQuillCollapse: typeof import('~icons/quill/collapse')['default']
@@ -202,11 +208,17 @@ declare global {
const IconMaterialSymbolsUploadRounded: typeof import('~icons/material-symbols/upload-rounded')['default']
const IconMaterialSymbolsWarningOutlineRounded: typeof import('~icons/material-symbols/warning-outline-rounded')['default']
const IconMdiArrowDownThin: typeof import('~icons/mdi/arrow-down-thin')['default']
+ const IconMdiArrowRightThick: typeof import('~icons/mdi/arrow-right-thick')['default']
const IconMdiArrowUpThin: typeof import('~icons/mdi/arrow-up-thin')['default']
+ const IconMdiCheckCircleOutline: typeof import('~icons/mdi/check-circle-outline')['default']
const IconMdiDrag: typeof import('~icons/mdi/drag')['default']
const IconMdiGithub: typeof import('~icons/mdi/github')['default']
const IconMdiKeyboardEsc: typeof import('~icons/mdi/keyboard-esc')['default']
const IconMdiKeyboardReturn: typeof import('~icons/mdi/keyboard-return')['default']
+ const IconMdiLoading: typeof import('~icons/mdi/loading')['default']
+ const IconMdiRefresh: typeof import('~icons/mdi/refresh')['default']
+ const IconMdiShieldAlertOutline: typeof import('~icons/mdi/shield-alert-outline')['default']
+ const IconMdiShieldCheckOutline: typeof import('~icons/mdi/shield-check-outline')['default']
const IconOcticonPin16: typeof import('~icons/octicon/pin16')['default']
const IconOcticonPinSlash16: typeof import('~icons/octicon/pin-slash16')['default']
const IconQuillCollapse: typeof import('~icons/quill/collapse')['default']
diff --git a/src/views/_builtin/login/modules/pwd-login.vue b/src/views/_builtin/login/modules/pwd-login.vue
index 63f189c7..ca6ba4df 100644
--- a/src/views/_builtin/login/modules/pwd-login.vue
+++ b/src/views/_builtin/login/modules/pwd-login.vue
@@ -3,7 +3,7 @@ import { computed, reactive, ref } from 'vue';
import type { SelectOption } from 'naive-ui';
import { useLoading } from '@sa/hooks';
import CryptoJS from 'crypto-js';
-import { fetchCaptchaCode, fetchTenantList } from '@/service/api';
+import { fetchCaptchaCode } from '@/service/api';
import { fetchSocialAuthBinding } from '@/service/api/system';
import { useAuthStore } from '@/store/modules/auth';
import { useRouterPush } from '@/hooks/common/router';
@@ -22,7 +22,7 @@ const authStore = useAuthStore();
const { toggleLoginModule } = useRouterPush();
const { formRef, validate } = useNaiveForm();
const { loading: codeLoading, startLoading: startCodeLoading, endLoading: endCodeLoading } = useLoading();
-const { loading: tenantLoading, startLoading: startTenantLoading, endLoading: endTenantLoading } = useLoading();
+const { loading: tenantLoading } = useLoading();
const codeUrl = ref();
const captchaEnabled = ref(false);
@@ -55,24 +55,6 @@ const rules = computed>(() => {
return loginRules;
});
-async function handleFetchTenantList() {
- startTenantLoading();
- const { data, error } = await fetchTenantList();
- if (error) return;
- tenantEnabled.value = data.tenantEnabled;
- if (data.tenantEnabled) {
- tenantOption.value = data.voList.map(tenant => {
- return {
- label: tenant.companyName,
- value: tenant.tenantId
- };
- });
- }
- endTenantLoading();
-}
-
-handleFetchTenantList();
-
async function handleSubmit() {
await validate();
// 勾选了需要记住密码设置在 localStorage 中设置记住用户名和密码
@@ -86,6 +68,7 @@ async function handleSubmit() {
try {
await authStore.login(model);
} catch {
+ // 登录失败后验证码已消费,刷新并重置
handleFetchCaptchaCode();
}
}
diff --git a/src/views/_builtin/login/modules/register.vue b/src/views/_builtin/login/modules/register.vue
index b276da7c..f0769345 100644
--- a/src/views/_builtin/login/modules/register.vue
+++ b/src/views/_builtin/login/modules/register.vue
@@ -2,7 +2,7 @@
import { computed, reactive, ref } from 'vue';
import type { SelectOption } from 'naive-ui';
import { useLoading } from '@sa/hooks';
-import { fetchCaptchaCode, fetchRegister, fetchTenantList } from '@/service/api';
+import { fetchCaptchaCode, fetchRegister } from '@/service/api';
import { useRouterPush } from '@/hooks/common/router';
import { useFormRules, useNaiveForm } from '@/hooks/common/form';
import { $t } from '@/locales';
@@ -72,20 +72,6 @@ async function handleSubmit() {
}
}
-async function handleFetchTenantList() {
- const { data, error } = await fetchTenantList();
- if (error) return;
- tenantEnabled.value = data.tenantEnabled;
- tenantOption.value = data.voList.map(tenant => {
- return {
- label: tenant.companyName,
- value: tenant.tenantId
- };
- });
-}
-
-handleFetchTenantList();
-
async function handleFetchCaptchaCode() {
startCodeLoading();
const { data, error } = await fetchCaptchaCode();