refactor(系统设置): 扫码登陆设置优化
This commit is contained in:
parent
283e55a675
commit
bd7a135147
|
@ -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<PlatformSourceList>({ url: GetPlatformInfoUrl });
|
||||
}
|
||||
|
||||
// 开启企业微信登陆
|
||||
export function closeValidateWeCom() {
|
||||
return MSR.post({ url: PostWeComValidateFalseUrl });
|
||||
}
|
||||
|
||||
// 开启钉钉登陆
|
||||
export function closeValidateDingTalk() {
|
||||
return MSR.post({ url: PostDingTalkValidateFalseUrl });
|
||||
}
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue