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);