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); + } }