diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java index de0febe456..6b403cfa1f 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java @@ -14,7 +14,7 @@ public class FilterChainUtils { filterChainDefinitionMap.put("/we_com/info", "anon"); filterChainDefinitionMap.put("/ding_talk/info", "anon"); filterChainDefinitionMap.put("/sso/callback/we_com", "anon"); - filterChainDefinitionMap.put("/auth", "anon"); + filterChainDefinitionMap.put("/sso/callback/ding_talk", "anon"); filterChainDefinitionMap.put("/setting/get/platform/param", "anon"); filterChainDefinitionMap.put("/signout", "anon"); filterChainDefinitionMap.put("/is-login", "anon"); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java index 6f498b1bed..c56c4f28a7 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java @@ -301,15 +301,7 @@ public class FunctionalCaseMinderService { Map customFieldNameMap = getCustomFieldNameMap(request); List addList = resourceMap.get(OperationLogType.ADD.toString()); List updatePosList = new ArrayList<>(); - CustomFieldExample customFieldExample = new CustomFieldExample(); - customFieldExample.createCriteria().andNameEqualTo("functional_priority").andSceneEqualTo(TemplateScene.FUNCTIONAL.toString()).andInternalEqualTo(true); - List defaultCustomFields = customFieldMapper.selectByExample(customFieldExample); - CustomField customField = defaultCustomFields.get(0); - TemplateDTO defaultTemplateDTO = projectTemplateService.getDefaultTemplateDTO(request.getProjectId(), TemplateScene.FUNCTIONAL.toString()); - List customFields = defaultTemplateDTO.getCustomFields(); - Map defaultValueMap = customFields.stream().filter(t -> t.getDefaultValue() != null).collect(Collectors.toMap(TemplateCustomFieldDTO::getFieldId, TemplateCustomFieldDTO::getDefaultValue)); - defaultValueMap.putIfAbsent(customField.getId(), "P0"); - + Map defaultValueMap = getDefaultValueMap(request); if (CollectionUtils.isNotEmpty(addList)) { Map> moduleCaseMap = getModuleCaseMap(addList); for (FunctionalCaseChangeRequest functionalCaseChangeRequest : addList) { @@ -399,6 +391,24 @@ public class FunctionalCaseMinderService { commonNoticeSendService.sendNotice(NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK, NoticeConstants.Event.UPDATE, resources, user, request.getProjectId()); } + @NotNull + private Map getDefaultValueMap(FunctionalCaseMinderEditRequest request) { + TemplateDTO defaultTemplateDTO = projectTemplateService.getDefaultTemplateDTO(request.getProjectId(), TemplateScene.FUNCTIONAL.toString()); + List customFields = defaultTemplateDTO.getCustomFields(); + Map defaultValueMap = new HashMap<>(); + for (TemplateCustomFieldDTO field : customFields) { + if (StringUtils.equalsIgnoreCase(field.getFieldName(), "functional_priority")) { + if (field.getDefaultValue() == null) { + field.setDefaultValue("P0"); + } + } + if (field.getDefaultValue() != null) { + defaultValueMap.put(field.getFieldId(), field.getDefaultValue()); + } + } + return defaultValueMap; + } + private void dealAdditionalNode(FunctionalCaseMinderEditRequest request, String userId, MindAdditionalNodeMapper additionalNodeMapper, Map newModuleMap) { if (CollectionUtils.isNotEmpty(request.getAdditionalNodeList())) { List updatePosList = new ArrayList<>(); diff --git a/frontend/src/api/requrls/user.ts b/frontend/src/api/requrls/user.ts index 87f42c3a5c..6c3ab64430 100644 --- a/frontend/src/api/requrls/user.ts +++ b/frontend/src/api/requrls/user.ts @@ -30,4 +30,4 @@ export const GetWeComInfoUrl = '/we_com/info'; // 获取企业微信登陆的配 export const GetWeComCallbackUrl = '/sso/callback/we_com'; // 获取企业微信登陆的回调信息 export const GetPlatformParamUrl = '/setting/get/platform/param'; export const GeDingInfoUrl = '/ding_talk/info'; // 获取企业微信登陆的配置信息 -export const GetDingCallbackUrl = '/auth'; // 获取企业微信登陆的回调信息 +export const GetDingCallbackUrl = '/sso/callback/ding_talk'; // 获取企业微信登陆的回调信息 diff --git a/frontend/src/models/user.ts b/frontend/src/models/user.ts index bb05ac3b98..9037925324 100644 --- a/frontend/src/models/user.ts +++ b/frontend/src/models/user.ts @@ -23,7 +23,7 @@ export interface WecomInfo { // 企业微信对接信息 export interface DingInfo { - agentId?: string; + appKey?: string; state?: string; callBack?: string; } diff --git a/frontend/src/views/login/components/dingTalkQrCode.vue b/frontend/src/views/login/components/dingTalkQrCode.vue index 13a86603a9..d46b6de9c1 100644 --- a/frontend/src/views/login/components/dingTalkQrCode.vue +++ b/frontend/src/views/login/components/dingTalkQrCode.vue @@ -37,7 +37,7 @@ }, { redirect_uri: url, - client_id: data.agentId ? data.agentId : '', + client_id: data.appKey ? data.appKey : '', scope: 'openid', response_type: 'code', state: 'fit2cloud-ding-qr', @@ -45,6 +45,8 @@ }, 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')); diff --git a/frontend/src/views/login/components/tabQrCode.vue b/frontend/src/views/login/components/tabQrCode.vue index e09f786577..07db310cd0 100644 --- a/frontend/src/views/login/components/tabQrCode.vue +++ b/frontend/src/views/login/components/tabQrCode.vue @@ -1,7 +1,7 @@