Skip to content

Commit 987dddf

Browse files
committed
refactor(system/client): 移除终端部分配置字段
1 parent f77f714 commit 987dddf

File tree

5 files changed

+31
-76
lines changed

5 files changed

+31
-76
lines changed

src/apis/system/type.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,8 @@ export interface StorageQuery {
268268
export interface ClientResp {
269269
id: string
270270
clientId: string
271-
clientKey: string
272-
clientSecret: string
273-
authType: string
274271
clientType: string
272+
authType: string
275273
activeTimeout: string
276274
timeout: string
277275
status: string
@@ -285,10 +283,8 @@ export interface ClientResp {
285283
export interface ClientDetailResp {
286284
id: string
287285
clientId: string
288-
clientKey: string
289-
clientSecret: string
290-
authType: string
291286
clientType: string
287+
authType: string
292288
activeTimeout: string
293289
timeout: string
294290
status: string
@@ -300,10 +296,8 @@ export interface ClientDetailResp {
300296
updateUserString: string
301297
}
302298
export interface ClientQuery {
303-
clientKey: string
304-
clientSecret: string
305-
authType: string[]
306299
clientType: string
300+
authType: string[]
307301
status: string
308302
sort: Array<string>
309303
}

src/views/open/app/AppDetailDrawer.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
<template>
2-
<a-drawer v-model:visible="visible" title="应用详情" :width="width >= 500 ? 500 : '100%'" :footer="false">
2+
<a-drawer v-model:visible="visible" title="应用详情" :width="width >= 600 ? 600 : '100%'" :footer="false">
33
<a-descriptions :column="2" size="large" class="general-description">
44
<a-descriptions-item label="ID">{{ dataDetail?.id }}</a-descriptions-item>
55
<a-descriptions-item label="名称">{{ dataDetail?.name }}</a-descriptions-item>
66
<a-descriptions-item label="Access Key" :span="2"><CellCopy :content="dataDetail?.accessKey" /></a-descriptions-item>
7-
<a-descriptions-item label="状态"><GiCellStatus :status="dataDetail?.status" /></a-descriptions-item>
7+
<a-descriptions-item label="状态">
8+
<a-tag v-if="dataDetail?.status === 1" color="green">启用</a-tag>
9+
<a-tag v-else color="red">禁用</a-tag>
10+
</a-descriptions-item>
811
<a-descriptions-item label="失效时间">{{ dataDetail?.expireTime }}</a-descriptions-item>
912
<a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
1013
<a-descriptions-item label="创建时间">{{ dataDetail?.createTime }}</a-descriptions-item>

src/views/system/config/client/ClientAddModal.vue

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<script setup lang="tsx">
1717
import { Message } from '@arco-design/web-vue'
1818
import { useWindowSize } from '@vueuse/core'
19-
import CryptoJS from 'crypto-js'
2019
import { addClient, getClient, updateClient } from '@/apis/system/client'
2120
import { type ColumnItem, GiForm } from '@/components/GiForm'
2221
import { DisEnableStatusList } from '@/constant/common'
@@ -43,39 +42,15 @@ const [form, resetForm] = useResetReactive({
4342
isShare: 1,
4443
status: 1,
4544
})
46-
const handleGenerate = () => {
47-
const timestamp = Date.now()
48-
form.clientSecret = CryptoJS.MD5(`${timestamp}`).toString(CryptoJS.enc.Hex)
49-
}
5045
5146
const columns: ColumnItem[] = reactive([
5247
{
53-
label: '终端 Key',
54-
field: 'clientKey',
55-
type: 'input',
56-
span: 24,
57-
required: true,
48+
label: '终端类型',
49+
field: 'clientType',
50+
type: 'select',
51+
span: 12,
5852
props: {
59-
maxLength: 32,
60-
},
61-
disabled: () => isUpdate.value,
62-
},
63-
{
64-
label: '终端秘钥',
65-
field: 'clientSecret',
66-
type: 'input',
67-
span: 24,
68-
required: true,
69-
disabled: () => isUpdate.value,
70-
slots: {
71-
append: () => (
72-
<a-button onClick={handleGenerate}>
73-
{{
74-
default: '随机生成',
75-
icon: <icon-refresh />,
76-
}}
77-
</a-button>
78-
),
53+
options: client_type,
7954
},
8055
},
8156
{
@@ -90,15 +65,6 @@ const columns: ColumnItem[] = reactive([
9065
maxTagCount: 2,
9166
},
9267
},
93-
{
94-
label: '终端类型',
95-
field: 'clientType',
96-
type: 'select',
97-
span: 12,
98-
props: {
99-
options: client_type,
100-
},
101-
},
10268
{
10369
label: () => (
10470
<a-tooltip content="-1 代表不限制,永不冻结">

src/views/system/config/client/ClientDetailDrawer.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
<a-descriptions :column="2" size="large" class="general-description">
44
<a-descriptions-item label="ID">{{ dataDetail?.id }}</a-descriptions-item>
55
<a-descriptions-item label="终端ID" :span="2"><a-typography-paragraph :copyable="!!dataDetail?.clientId">{{ dataDetail?.clientId }}</a-typography-paragraph></a-descriptions-item>
6-
<a-descriptions-item label="终端Key" :span="2">{{ dataDetail?.clientKey }}</a-descriptions-item>
7-
<a-descriptions-item label="终端秘钥" :span="2">{{ dataDetail?.clientSecret }}</a-descriptions-item>
6+
<a-descriptions-item label="终端类型" :span="2">
7+
<GiCellTag :value="dataDetail?.clientType" :dict="client_type" />
8+
</a-descriptions-item>
89
<a-descriptions-item label="认证类型" :span="2">
910
<a-space>
1011
<GiCellTag v-for="(item, index) in dataDetail?.authType" :key="index" :value="item" :dict="auth_type_enum" />
1112
</a-space>
1213
</a-descriptions-item>
13-
<a-descriptions-item label="终端类型" :span="2">
14-
<GiCellTag :value="dataDetail?.clientType" :dict="client_type" />
15-
</a-descriptions-item>
1614
<a-descriptions-item label="Token最低活跃频率">{{ dataDetail?.activeTimeout }}</a-descriptions-item>
1715
<a-descriptions-item label="Token有效期">{{ dataDetail?.timeout }}</a-descriptions-item>
1816
<a-descriptions-item label="状态" :span="2">
19-
<GiCellStatus :status="dataDetail?.status" />
17+
<a-tag v-if="dataDetail?.status === 1" color="green">启用</a-tag>
18+
<a-tag v-else color="red">禁用</a-tag>
2019
</a-descriptions-item>
2120
<a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
2221
<a-descriptions-item label="创建时间">{{ dataDetail?.createTime }}</a-descriptions-item>

src/views/system/config/client/index.vue

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
:data="dataList"
66
:columns="columns"
77
:loading="loading"
8-
:scroll="{ x: '100%', y: '100%', minWidth: 1500 }"
8+
:scroll="{ x: '100%', y: '100%', minWidth: 1200 }"
99
:pagination="pagination"
1010
:disabled-tools="['size']"
1111
:disabled-column-keys="['clientKey']"
1212
@refresh="search"
1313
>
1414
<template #toolbar-left>
15-
<a-input-search v-model="queryForm.clientKey" placeholder="搜索终端Key" allow-clear @search="search" />
1615
<a-select
1716
v-model="queryForm.clientType"
1817
:options="client_type"
@@ -83,10 +82,8 @@ const {
8382
} = useDict('client_type', 'auth_type_enum')
8483
8584
const queryForm = reactive<ClientQuery>({
86-
clientKey: '',
87-
clientSecret: '',
88-
authType: [] as string[],
8985
clientType: '',
86+
authType: [] as string[],
9087
status: '',
9188
sort: ['id,desc'],
9289
})
@@ -123,30 +120,28 @@ const columns: TableInstance['columns'] = [
123120
)
124121
},
125122
},
126-
{ title: '终端 Key', dataIndex: 'clientKey', slotName: 'clientKey', ellipsis: true, tooltip: true, align: 'center' },
127-
{ title: '终端秘钥', dataIndex: 'clientSecret', slotName: 'clientSecret', ellipsis: true, tooltip: true, align: 'center' },
128123
{
129-
title: '认证类型',
130-
dataIndex: 'authType',
131-
slotName: 'authType',
124+
title: '终端类型',
125+
dataIndex: 'clientType',
126+
slotName: 'clientType',
132127
ellipsis: true,
133128
tooltip: true,
134129
align: 'center',
135130
render: ({ record }) => {
136-
return (
137-
<GiCellTags data={formatAuthType(record.authType)} />
138-
)
131+
return <GiCellTag value={record.clientType} dict={client_type.value} />
139132
},
140133
},
141134
{
142-
title: '终端类型',
143-
dataIndex: 'clientType',
144-
slotName: 'clientType',
135+
title: '认证类型',
136+
dataIndex: 'authType',
137+
slotName: 'authType',
145138
ellipsis: true,
146139
tooltip: true,
147140
align: 'center',
148141
render: ({ record }) => {
149-
return <GiCellTag value={record.clientType} dict={client_type.value} />
142+
return (
143+
<GiCellTags data={formatAuthType(record.authType)} />
144+
)
150145
},
151146
},
152147
{ title: 'Token 最低活跃频率', dataIndex: 'activeTimeout', slotName: 'activeTimeout', width: 180, align: 'center', render: ({ record }) => `${record.activeTimeout} 秒` },
@@ -177,10 +172,8 @@ const columns: TableInstance['columns'] = [
177172
178173
// 重置
179174
const reset = () => {
180-
queryForm.clientKey = ''
181-
queryForm.clientSecret = ''
182-
queryForm.authType = []
183175
queryForm.clientType = ''
176+
queryForm.authType = []
184177
queryForm.status = ''
185178
search()
186179
}

0 commit comments

Comments
 (0)