From bd7a1351477fca01c0b11b9bcb68e65973be45f9 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 24 Jun 2024 11:02:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E6=89=AB=E7=A0=81=E7=99=BB=E9=99=86=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/setting/qrCode.ts | 12 ++++++++++++ frontend/src/api/requrls/setting/qrCode.ts | 2 ++ .../system/config/components/dingTalkModal.vue | 2 +- .../system/config/components/qrCodeConfig.vue | 9 ++++++++- .../setting/system/config/components/weComModal.vue | 2 +- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/frontend/src/api/modules/setting/qrCode.ts b/frontend/src/api/modules/setting/qrCode.ts index 98b682cdc5..0f638edbf9 100644 --- a/frontend/src/api/modules/setting/qrCode.ts +++ b/frontend/src/api/modules/setting/qrCode.ts @@ -5,10 +5,12 @@ import { GetWeComInfoUrl, PostDingTalkEnableUrl, PostDingTalkSaveUrl, + PostDingTalkValidateFalseUrl, PostValidateDingTalkUrl, PostValidateWeComUrl, PostWeComEnableUrl, PostWeComSaveUrl, + PostWeComValidateFalseUrl, } from '@/api/requrls/setting/qrCode'; import { DingTalkInfo, EnableEditorRequest, PlatformSourceList, WeComInfo } from '@/models/setting/qrCode'; @@ -57,3 +59,13 @@ export function enableDingTalk(data: EnableEditorRequest) { export function getPlatformSourceList() { return MSR.get({ url: GetPlatformInfoUrl }); } + +// 开启企业微信登陆 +export function closeValidateWeCom() { + return MSR.post({ url: PostWeComValidateFalseUrl }); +} + +// 开启钉钉登陆 +export function closeValidateDingTalk() { + return MSR.post({ url: PostDingTalkValidateFalseUrl }); +} diff --git a/frontend/src/api/requrls/setting/qrCode.ts b/frontend/src/api/requrls/setting/qrCode.ts index 2519c4d1fe..721efc1e77 100644 --- a/frontend/src/api/requrls/setting/qrCode.ts +++ b/frontend/src/api/requrls/setting/qrCode.ts @@ -7,3 +7,5 @@ export const GetDingTalkInfoUrl = '/ding_talk/info/with_detail'; export const PostDingTalkSaveUrl = '/ding_talk/save'; export const PostDingTalkEnableUrl = '/ding_talk/enable'; export const GetPlatformInfoUrl = '/setting/get/platform/info'; +export const PostWeComValidateFalseUrl = '/we_com/change/validate'; +export const PostDingTalkValidateFalseUrl = '/ding_talk/change/validate'; diff --git a/frontend/src/views/setting/system/config/components/dingTalkModal.vue b/frontend/src/views/setting/system/config/components/dingTalkModal.vue index 5db44546c4..c9c6eed8b6 100644 --- a/frontend/src/views/setting/system/config/components/dingTalkModal.vue +++ b/frontend/src/views/setting/system/config/components/dingTalkModal.vue @@ -149,7 +149,7 @@ try { await validateDingTalkConfig(dingTalkForm.value); dingTalkForm.value.valid = true; - Message.success(t('organization.service.testLinkStatusTip')); + Message.success(t('common.saveSuccess')); } catch (error) { console.log(error); } finally { diff --git a/frontend/src/views/setting/system/config/components/qrCodeConfig.vue b/frontend/src/views/setting/system/config/components/qrCodeConfig.vue index dd05d0bca6..00d60c8659 100644 --- a/frontend/src/views/setting/system/config/components/qrCodeConfig.vue +++ b/frontend/src/views/setting/system/config/components/qrCodeConfig.vue @@ -116,6 +116,8 @@ import WeComModal from '@/views/setting/system/config/components/weComModal.vue'; import { + closeValidateDingTalk, + closeValidateWeCom, enableDingTalk, enableWeCom, getPlatformSourceList, @@ -224,10 +226,15 @@ await validateDingTalkConfig(dingTalkInfo.value); } Message.success(t('organization.service.testLinkStatusTip')); - loadList(); } catch (error) { + if (key === 'WE_COM') { + await closeValidateWeCom(); + } else if (key === 'DING_TALK') { + await closeValidateDingTalk(); + } console.log(error); } finally { + loadList(); loading.value = false; } }; diff --git a/frontend/src/views/setting/system/config/components/weComModal.vue b/frontend/src/views/setting/system/config/components/weComModal.vue index 7a9749a859..bd9d98c325 100644 --- a/frontend/src/views/setting/system/config/components/weComModal.vue +++ b/frontend/src/views/setting/system/config/components/weComModal.vue @@ -162,7 +162,7 @@ loading.value = true; try { await saveWeComConfig(weComForm.value); - Message.success(t('organization.service.testLinkStatusTip')); + Message.success(t('common.saveSuccess')); emits('success'); } catch (error) { console.log(error);