From 549685049a44daee85b0641156eb0b9f2271ca8b Mon Sep 17 00:00:00 2001 From: baiqi Date: Thu, 25 Jul 2024 16:14:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A0=E7=BB=84=E7=BB=87=E6=97=A0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/setting/organizationAndProject.ts | 2 +- frontend/src/api/modules/user/index.ts | 2 +- .../components/localExec.vue | 110 ------------------ .../src/views/login/components/login-form.vue | 2 +- 4 files changed, 3 insertions(+), 113 deletions(-) diff --git a/frontend/src/api/modules/setting/organizationAndProject.ts b/frontend/src/api/modules/setting/organizationAndProject.ts index 9b4a77f1c6..49193fd820 100644 --- a/frontend/src/api/modules/setting/organizationAndProject.ts +++ b/frontend/src/api/modules/setting/organizationAndProject.ts @@ -104,7 +104,7 @@ export function enableOrDisableProject(id: string, isEnable = true) { // 获取组织下拉选项 export function getSystemOrgOption() { - return MSR.post({ url: orgUrl.postOrgOptionsUrl }); + return MSR.post({ url: orgUrl.postOrgOptionsUrl }, { ignoreCancelToken: true }); } // 创建或更新项目 diff --git a/frontend/src/api/modules/user/index.ts b/frontend/src/api/modules/user/index.ts index 42ffaa584e..31009f9283 100644 --- a/frontend/src/api/modules/user/index.ts +++ b/frontend/src/api/modules/user/index.ts @@ -139,7 +139,7 @@ export function validLocalConfig(host: string) { // 个人设置-获取本地执行配置 export function getLocalConfig() { - return MSR.get({ url: GetLocalConfigUrl }); + return MSR.get({ url: GetLocalConfigUrl }, { ignoreCancelToken: true }); } // 个人设置-启用本地执行配置 diff --git a/frontend/src/components/business/ms-personal-drawer/components/localExec.vue b/frontend/src/components/business/ms-personal-drawer/components/localExec.vue index cb2331ace4..7cc39e53cc 100644 --- a/frontend/src/components/business/ms-personal-drawer/components/localExec.vue +++ b/frontend/src/components/business/ms-personal-drawer/components/localExec.vue @@ -54,52 +54,6 @@ - - @@ -240,65 +194,6 @@ } } - const testUiLoading = ref(false); - const uiConfig = ref({ - id: '', - userUrl: '', - enable: false, - type: 'UI', - status: 0, - }); - - async function testUi() { - if (uiConfig.value.userUrl.trim() === '') { - return; - } - try { - testUiLoading.value = true; - if (uiConfig.value.id) { - // 已经存在配置 - await updateLocalConfig({ - id: uiConfig.value.id, - userUrl: uiConfig.value.userUrl.trim(), - }); - } else { - const result = await addLocalConfig({ - type: 'UI', - userUrl: uiConfig.value.userUrl.trim(), - }); - uiConfig.value.id = result.id; - } - const res = await validLocalConfig(uiConfig.value.userUrl.trim()); - uiConfig.value.status = res === 'OK' ? 1 : 2; - if (res) { - Message.success(t('ms.personal.testPass')); - } else { - Message.error(t('ms.personal.testFail')); - } - } catch (error) { - // eslint-disable-next-line no-console - console.log(error); - } finally { - testUiLoading.value = false; - } - } - - async function handleUiPriorityBeforeChange(val: string | number | boolean) { - try { - if (val) { - await enableLocalConfig(uiConfig.value.id); - } else { - await disableLocalConfig(uiConfig.value.id); - } - Message.success(val ? t('ms.personal.uiLocalExecutionOpen') : t('ms.personal.uiLocalExecutionClose')); - return true; - } catch (error) { - // eslint-disable-next-line no-console - console.log(error); - return false; - } - } - onBeforeMount(async () => { try { loading.value = true; @@ -313,11 +208,6 @@ ...config, status: 'none', }; - } else if (config.type === 'UI') { - uiConfig.value = { - ...config, - status: 'none', - }; } }); } diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue index c58732d723..3631a055a2 100644 --- a/frontend/src/views/login/components/login-form.vue +++ b/frontend/src/views/login/components/login-form.vue @@ -219,6 +219,7 @@ password: encrypted(values.password), authenticate: userInfo.value.authenticate, } as LoginData); + setLoginExpires(); setLongType(userInfo.value.authenticate); Message.success(t('login.form.login.success')); const { rememberPassword } = loginConfig.value; @@ -250,7 +251,6 @@ if (res) { appStore.setCurrentMenuConfig(res?.moduleIds || []); } - setLoginExpires(); router.push({ name: redirectHasPermission ? (redirect as string) : currentRouteName, query: {