refactor(测试计划): 脑图查询接口连调以及扫码登陆修改

This commit is contained in:
guoyuqi 2024-06-12 17:33:54 +08:00 committed by 刘瑞斌
parent 035b8f8f61
commit 8874a40b5b
7 changed files with 48 additions and 19 deletions

View File

@ -304,7 +304,11 @@ public class TestPlanCollectionMinderService {
testPlanCollection.setTestPlanId(request.getPlanId());
testPlanCollection.setType(testPlanCollectionMinderEditDTO.getCollectionType());
TestPlanCollection parent = parentMap.get(testPlanCollectionMinderEditDTO.getCollectionType()).get(0);
testPlanCollection.setParentId(parent.getId());
if (StringUtils.equalsIgnoreCase(parent.getId(), testPlanCollectionMinderEditDTO.getId())) {
testPlanCollection.setParentId(parent.getParentId());
} else {
testPlanCollection.setParentId(parent.getId());
}
testPlanCollection.setCreateUser(userId);
testPlanCollection.setCreateTime(null);
testPlanCollection.setPos(testPlanCollectionMinderEditDTO.getNum());

View File

@ -28,7 +28,7 @@
const initActive = async () => {
const data = await getDingInfo();
await load(true);
const url = encodeURIComponent(data.callBack ? data.callBack : '');
const url = encodeURIComponent(window.location.origin);
window.DTFrameLogin(
{
id: 'ding-talk-qr',
@ -45,8 +45,6 @@
},
async (loginResult) => {
const { redirectUrl, authCode, state } = loginResult;
console.log('authCode');
console.log(authCode);
const dingCallback = getDingCallback(authCode);
userStore.qrCodeLogin(await dingCallback);
Message.success(t('login.form.login.success'));

View File

@ -74,7 +74,7 @@
</div>
</a-form>
<div v-if="showQrCodeTab">
<tab-qr-code tab-name="wecom"></tab-qr-code>
<tab-qr-code tab-name="WE_COM"></tab-qr-code>
</div>
<a-divider
v-if="isShowLDAP || isShowOIDC || isShowOAUTH || (isShowQRCode && orgOptions.length > 0)"
@ -117,7 +117,6 @@
import { useStorage } from '@vueuse/core';
import { Message, SelectOptionData } from '@arco-design/web-vue';
import MsIcon from '@/components/pure/ms-icon-font/index.vue';
import TabQrCode from '@/views/login/components/tabQrCode.vue';
import { getProjectInfo } from '@/api/modules/project-management/basicInfo';

View File

@ -1,22 +1,23 @@
<template>
<a-radio-group v-model:active-key="activeName" type="button" class="tabPlatform" @change="handleClick">
<a-radio value="wecom" class="radioOneButton">{{ t('project.messageManagement.WE_COM') }}</a-radio>
<a-radio value="dingtalk" class="radioOneButton">{{ t('project.messageManagement.DING_TALK') }}</a-radio>
<a-radio v-for="item of orgOptions" :key="item.value" :value="item.value" :v-show="item.label">
{{ t('project.messageManagement' + item.value) }}
</a-radio>
<!-- <a-tab-pane key="lark" :title="t('project.messageManagement.LARK')"></a-tab-pane>
<a-tab-pane key="larksuite" :title="t('project.messageManagement.LARK_SUITE')"></a-tab-pane>-->
</a-radio-group>
<div v-if="activeName === 'wecom'" class="login-qrcode">
<div v-if="activeName === 'WE_COM'" class="login-qrcode">
<div class="qrcode">
<wecom-qr v-if="activeName === 'wecom'" />
<wecom-qr v-if="activeName === 'WE_COM'" />
</div>
</div>
<div v-if="activeName === 'dingtalk'" class="login-qrcode">
<div v-if="activeName === 'DING_TALK'" class="login-qrcode">
<div class="qrcode">
<div class="title">
<MsIcon type="icon-logo_dingtalk" size="24"></MsIcon>
钉钉登录
</div>
<ding-talk-qr v-if="activeName === 'dingtalk'" />
<ding-talk-qr v-if="activeName === 'DING_TALK'" />
</div>
</div>
<!--
@ -40,14 +41,23 @@
import dingTalkQr from './dingTalkQrCode.vue';
import WecomQr from './weComQrCode.vue';
import { getPlatformParamUrl } from '@/api/modules/user';
const { t } = useI18n();
const activeName = ref('');
interface qrOption {
value: string;
label: string;
}
const orgOptions = ref<qrOption[]>([]);
const props = defineProps<{
tabName: string;
}>();
const initActive = () => {
const qrArray = ['wecom', 'dingtalk', 'lark', 'larksuite'];
const qrArray = ['WE_COM', 'DING_TALK', 'lark', 'larksuite'];
for (let i = 0; i < qrArray.length; i++) {
const key = qrArray[i];
if (props.tabName === key) {
@ -60,11 +70,24 @@
if (typeof val === 'string') {
activeName.value = val;
} else {
activeName.value = 'wecom';
activeName.value = 'WE_COM';
}
}
async function initPlatformInfo() {
try {
const res = await getPlatformParamUrl();
orgOptions.value = res.map((e) => ({
label: e.name,
value: e.id,
}));
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
}
}
onMounted(() => {
initActive();
initPlatformInfo();
});
</script>

View File

@ -16,7 +16,7 @@
import { getFirstRouteNameByPermission, routerNameHasPermission } from '@/utils/permission';
import * as ww from '@wecom/jssdk';
import { WWLoginRedirectType, WWLoginType } from '@wecom/jssdk';
import { WWLoginPanelSizeType, WWLoginRedirectType, WWLoginType } from '@wecom/jssdk';
const { t } = useI18n();
@ -27,6 +27,10 @@
const wwLogin = ref({});
const obj = ref<any>({
isWeComLogin: false,
});
const init = async () => {
const data = await getWeComInfo();
wwLogin.value = ww.createWWLoginPanel({
@ -35,13 +39,12 @@
login_type: WWLoginType.corpApp,
appid: data.corpId ? data.corpId : '',
agentid: data.agentId,
redirect_uri: data.callBack ? data.callBack : '',
redirect_uri: window.location.origin,
state: 'fit2cloud-wecom-qr',
redirect_type: WWLoginRedirectType.callback,
panel_size: WWLoginPanelSizeType.small,
},
onCheckWeComLogin({ isWeComLogin }: any) {
console.log(isWeComLogin);
},
onCheckWeComLogin: obj.value,
async onLoginSuccess({ code }: any) {
const weComCallback = getWeComCallback(code);
userStore.qrCodeLogin(await weComCallback);

View File

@ -152,6 +152,7 @@
loading.value = true;
try {
await validateDingTalkConfig(dingTalkForm.value);
dingTalkForm.value.valid = true;
Message.success(t('organization.service.testLinkStatusTip'));
} catch (error) {
console.log(error);

View File

@ -149,6 +149,7 @@
loading.value = true;
try {
await validateWeComConfig(weComForm.value);
weComForm.value.valid = true;
Message.success(t('organization.service.testLinkStatusTip'));
} catch (error) {
console.log(error);