From f10e6dbc71745657b97168040c2141cba80d9087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 16 Apr 2026 14:14:28 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF=E7=AE=A1=E7=90=86=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95=E8=B7=AF=E5=BE=84=E5=92=8C=E7=99=BD?= =?UTF-8?q?=E5=90=8D=E5=8D=95IP=E5=8A=9F=E8=83=BD=20=E5=8F=AF=E9=99=90?= =?UTF-8?q?=E5=88=B6=E5=AE=A2=E6=88=B7=E7=AB=AF=E8=83=BD=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E7=9A=84=E5=85=B7=E4=BD=93=E8=B7=AF=E5=BE=84=E4=B8=8E=E5=8F=AF?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E7=9A=84=E5=85=B7=E4=BD=93IP=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/client/types.ts | 50 ++++++++++++++++ src/views/system/client/index.vue | 99 ++++++++++++++++++++++++++++++- 2 files changed, 148 insertions(+), 1 deletion(-) diff --git a/src/api/system/client/types.ts b/src/api/system/client/types.ts index 142118d..c1d02d4 100644 --- a/src/api/system/client/types.ts +++ b/src/api/system/client/types.ts @@ -29,6 +29,26 @@ export interface ClientVO { */ deviceType: string; + /** + * 允许访问路径 + */ + accessPath?: string; + + /** + * 允许访问路径列表 + */ + accessPathList?: string[]; + + /** + * IP白名单 + */ + ipWhitelist?: string; + + /** + * IP白名单列表 + */ + ipWhitelistList?: string[]; + /** * token活跃超时时间 */ @@ -76,6 +96,26 @@ export interface ClientForm extends BaseEntity { */ deviceType?: string; + /** + * 允许访问路径 + */ + accessPath?: string; + + /** + * 允许访问路径列表 + */ + accessPathList?: string[]; + + /** + * IP白名单 + */ + ipWhitelist?: string; + + /** + * IP白名单列表 + */ + ipWhitelistList?: string[]; + /** * token活跃超时时间 */ @@ -118,6 +158,16 @@ export interface ClientQuery extends PageQuery { */ deviceType?: string; + /** + * 允许访问路径 + */ + accessPath?: string; + + /** + * IP白名单 + */ + ipWhitelist?: string; + /** * token活跃超时时间 */ diff --git a/src/views/system/client/index.vue b/src/views/system/client/index.vue index 2550f53..bbea51f 100644 --- a/src/views/system/client/index.vue +++ b/src/views/system/client/index.vue @@ -97,6 +97,41 @@ + + + + + {{ path }} + + + 全部路径 + + + + + + + + + {{ ip }} + + + 全部IP + + + + @@ -142,7 +177,7 @@ /> - + @@ -170,6 +205,38 @@ > + + + + + + + 允许访问路径 + + + + + + + + + + + IP白名单 + + + + @@ -245,6 +312,10 @@ const initFormData: ClientForm = { clientSecret: undefined, grantTypeList: undefined, deviceType: undefined, + accessPath: undefined, + accessPathList: undefined, + ipWhitelist: undefined, + ipWhitelistList: undefined, activeTimeout: undefined, timeout: undefined, status: '0' @@ -259,6 +330,8 @@ const data = reactive>({ clientSecret: undefined, grantType: undefined, deviceType: undefined, + accessPath: undefined, + ipWhitelist: undefined, activeTimeout: undefined, timeout: undefined, status: undefined @@ -275,6 +348,19 @@ const data = reactive>({ const { queryParams, form, rules } = toRefs(data); +const getRuleList = (ruleList?: string[], ruleValue?: string) => { + if (Array.isArray(ruleList) && ruleList.length) { + return ruleList; + } + if (!ruleValue) { + return []; + } + return ruleValue + .split(/[\n,;]+/) + .map(item => item.trim()) + .filter(Boolean); +}; + /** 查询客户端管理列表 */ const getList = async () => { loading.value = true; @@ -400,5 +486,16 @@ onMounted(() => { margin-left: 0 !important; margin-right: 0 !important; } + + .rule-tag-list { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 4px; + } + + .rule-empty { + color: var(--el-text-color-secondary); + } }