From c2df6e04e25a9978ff17dbff7df38be795204d12 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 4 Jun 2024 20:12:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=92=89=E9=92=89=E7=99=BB=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sdk/util/FilterChainUtils.java | 2 + frontend/src/api/modules/user/index.ts | 14 ++++- frontend/src/api/requrls/user.ts | 2 + frontend/src/models/user.ts | 7 +++ .../views/login/components/dingTalkQrCode.vue | 61 ++++++++++++++++--- .../src/views/login/components/tabQrCode.vue | 11 ++-- 6 files changed, 81 insertions(+), 16 deletions(-) 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 a5a7fb1005..de0febe456 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 @@ -12,7 +12,9 @@ public class FilterChainUtils { filterChainDefinitionMap.put("/ldap/login", "anon"); filterChainDefinitionMap.put("/authentication/get-list", "anon"); 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("/setting/get/platform/param", "anon"); filterChainDefinitionMap.put("/signout", "anon"); filterChainDefinitionMap.put("/is-login", "anon"); diff --git a/frontend/src/api/modules/user/index.ts b/frontend/src/api/modules/user/index.ts index a9c61283e8..debf21aa26 100644 --- a/frontend/src/api/modules/user/index.ts +++ b/frontend/src/api/modules/user/index.ts @@ -7,8 +7,10 @@ import { DisableLocalConfigUrl, EnableAPIKEYUrl, EnableLocalConfigUrl, + GeDingInfoUrl, GetAPIKEYListUrl, getAuthenticationUrl, + GetDingCallbackUrl, GetInfoUrl, GetLocalConfigUrl, GetMenuListUrl, @@ -46,7 +48,7 @@ import type { UpdateLocalConfigParams, UpdatePswParams, } from '@/models/user'; -import { WecomInfo } from '@/models/user'; +import { DingInfo, WecomInfo } from '@/models/user'; import type { RouteRecordNormalized } from 'vue-router'; @@ -83,6 +85,16 @@ export function getWeComCallback(code: string) { ); } +export function getDingInfo() { + return MSR.get({ url: GeDingInfoUrl }, { ignoreCancelToken: true, errorMessageMode: 'none' }); +} + +export function getDingCallback(code: string) { + return MSR.get( + { url: GetDingCallbackUrl, params: { code } }, + { ignoreCancelToken: true, errorMessageMode: 'none' } + ); +} export function logout() { return MSR.get({ url: LogoutUrl }); } diff --git a/frontend/src/api/requrls/user.ts b/frontend/src/api/requrls/user.ts index d78a4b0c2f..87f42c3a5c 100644 --- a/frontend/src/api/requrls/user.ts +++ b/frontend/src/api/requrls/user.ts @@ -29,3 +29,5 @@ export const GetPlatformOrgOptionUrl = '/user/platform/switch-option'; // 个人 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'; // 获取企业微信登陆的回调信息 diff --git a/frontend/src/models/user.ts b/frontend/src/models/user.ts index 37ea8ab5ea..bb05ac3b98 100644 --- a/frontend/src/models/user.ts +++ b/frontend/src/models/user.ts @@ -21,6 +21,13 @@ export interface WecomInfo { callBack?: string; } +// 企业微信对接信息 +export interface DingInfo { + agentId?: string; + state?: string; + callBack?: string; +} + // 更新本地执行配置 export interface UpdateLocalConfigParams { id: string; diff --git a/frontend/src/views/login/components/dingTalkQrCode.vue b/frontend/src/views/login/components/dingTalkQrCode.vue index e59b06ff95..13a86603a9 100644 --- a/frontend/src/views/login/components/dingTalkQrCode.vue +++ b/frontend/src/views/login/components/dingTalkQrCode.vue @@ -3,16 +3,32 @@