mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-09 20:57:17 +08:00
refactor(system/client): 移除终端部分配置字段
This commit is contained in:
@@ -268,10 +268,8 @@ export interface StorageQuery {
|
|||||||
export interface ClientResp {
|
export interface ClientResp {
|
||||||
id: string
|
id: string
|
||||||
clientId: string
|
clientId: string
|
||||||
clientKey: string
|
|
||||||
clientSecret: string
|
|
||||||
authType: string
|
|
||||||
clientType: string
|
clientType: string
|
||||||
|
authType: string
|
||||||
activeTimeout: string
|
activeTimeout: string
|
||||||
timeout: string
|
timeout: string
|
||||||
status: string
|
status: string
|
||||||
@@ -285,10 +283,8 @@ export interface ClientResp {
|
|||||||
export interface ClientDetailResp {
|
export interface ClientDetailResp {
|
||||||
id: string
|
id: string
|
||||||
clientId: string
|
clientId: string
|
||||||
clientKey: string
|
|
||||||
clientSecret: string
|
|
||||||
authType: string
|
|
||||||
clientType: string
|
clientType: string
|
||||||
|
authType: string
|
||||||
activeTimeout: string
|
activeTimeout: string
|
||||||
timeout: string
|
timeout: string
|
||||||
status: string
|
status: string
|
||||||
@@ -300,10 +296,8 @@ export interface ClientDetailResp {
|
|||||||
updateUserString: string
|
updateUserString: string
|
||||||
}
|
}
|
||||||
export interface ClientQuery {
|
export interface ClientQuery {
|
||||||
clientKey: string
|
|
||||||
clientSecret: string
|
|
||||||
authType: string[]
|
|
||||||
clientType: string
|
clientType: string
|
||||||
|
authType: string[]
|
||||||
status: string
|
status: string
|
||||||
sort: Array<string>
|
sort: Array<string>
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-drawer v-model:visible="visible" title="应用详情" :width="width >= 500 ? 500 : '100%'" :footer="false">
|
<a-drawer v-model:visible="visible" title="应用详情" :width="width >= 600 ? 600 : '100%'" :footer="false">
|
||||||
<a-descriptions :column="2" size="large" class="general-description">
|
<a-descriptions :column="2" size="large" class="general-description">
|
||||||
<a-descriptions-item label="ID">{{ dataDetail?.id }}</a-descriptions-item>
|
<a-descriptions-item label="ID">{{ dataDetail?.id }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="名称">{{ dataDetail?.name }}</a-descriptions-item>
|
<a-descriptions-item label="名称">{{ dataDetail?.name }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="Access Key" :span="2"><CellCopy :content="dataDetail?.accessKey" /></a-descriptions-item>
|
<a-descriptions-item label="Access Key" :span="2"><CellCopy :content="dataDetail?.accessKey" /></a-descriptions-item>
|
||||||
<a-descriptions-item label="状态"><GiCellStatus :status="dataDetail?.status" /></a-descriptions-item>
|
<a-descriptions-item label="状态">
|
||||||
|
<a-tag v-if="dataDetail?.status === 1" color="green">启用</a-tag>
|
||||||
|
<a-tag v-else color="red">禁用</a-tag>
|
||||||
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="失效时间">{{ dataDetail?.expireTime }}</a-descriptions-item>
|
<a-descriptions-item label="失效时间">{{ dataDetail?.expireTime }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
|
<a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="创建时间">{{ dataDetail?.createTime }}</a-descriptions-item>
|
<a-descriptions-item label="创建时间">{{ dataDetail?.createTime }}</a-descriptions-item>
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import { Message } from '@arco-design/web-vue'
|
import { Message } from '@arco-design/web-vue'
|
||||||
import { useWindowSize } from '@vueuse/core'
|
import { useWindowSize } from '@vueuse/core'
|
||||||
import CryptoJS from 'crypto-js'
|
|
||||||
import { addClient, getClient, updateClient } from '@/apis/system/client'
|
import { addClient, getClient, updateClient } from '@/apis/system/client'
|
||||||
import { type ColumnItem, GiForm } from '@/components/GiForm'
|
import { type ColumnItem, GiForm } from '@/components/GiForm'
|
||||||
import { DisEnableStatusList } from '@/constant/common'
|
import { DisEnableStatusList } from '@/constant/common'
|
||||||
@@ -43,39 +42,15 @@ const [form, resetForm] = useResetReactive({
|
|||||||
isShare: 1,
|
isShare: 1,
|
||||||
status: 1,
|
status: 1,
|
||||||
})
|
})
|
||||||
const handleGenerate = () => {
|
|
||||||
const timestamp = Date.now()
|
|
||||||
form.clientSecret = CryptoJS.MD5(`${timestamp}`).toString(CryptoJS.enc.Hex)
|
|
||||||
}
|
|
||||||
|
|
||||||
const columns: ColumnItem[] = reactive([
|
const columns: ColumnItem[] = reactive([
|
||||||
{
|
{
|
||||||
label: '终端 Key',
|
label: '终端类型',
|
||||||
field: 'clientKey',
|
field: 'clientType',
|
||||||
type: 'input',
|
type: 'select',
|
||||||
span: 24,
|
span: 12,
|
||||||
required: true,
|
|
||||||
props: {
|
props: {
|
||||||
maxLength: 32,
|
options: client_type,
|
||||||
},
|
|
||||||
disabled: () => isUpdate.value,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '终端秘钥',
|
|
||||||
field: 'clientSecret',
|
|
||||||
type: 'input',
|
|
||||||
span: 24,
|
|
||||||
required: true,
|
|
||||||
disabled: () => isUpdate.value,
|
|
||||||
slots: {
|
|
||||||
append: () => (
|
|
||||||
<a-button onClick={handleGenerate}>
|
|
||||||
{{
|
|
||||||
default: '随机生成',
|
|
||||||
icon: <icon-refresh />,
|
|
||||||
}}
|
|
||||||
</a-button>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -90,15 +65,6 @@ const columns: ColumnItem[] = reactive([
|
|||||||
maxTagCount: 2,
|
maxTagCount: 2,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '终端类型',
|
|
||||||
field: 'clientType',
|
|
||||||
type: 'select',
|
|
||||||
span: 12,
|
|
||||||
props: {
|
|
||||||
options: client_type,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: () => (
|
label: () => (
|
||||||
<a-tooltip content="-1 代表不限制,永不冻结">
|
<a-tooltip content="-1 代表不限制,永不冻结">
|
||||||
|
@@ -3,20 +3,19 @@
|
|||||||
<a-descriptions :column="2" size="large" class="general-description">
|
<a-descriptions :column="2" size="large" class="general-description">
|
||||||
<a-descriptions-item label="ID">{{ dataDetail?.id }}</a-descriptions-item>
|
<a-descriptions-item label="ID">{{ dataDetail?.id }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="终端ID" :span="2"><a-typography-paragraph :copyable="!!dataDetail?.clientId">{{ dataDetail?.clientId }}</a-typography-paragraph></a-descriptions-item>
|
<a-descriptions-item label="终端ID" :span="2"><a-typography-paragraph :copyable="!!dataDetail?.clientId">{{ dataDetail?.clientId }}</a-typography-paragraph></a-descriptions-item>
|
||||||
<a-descriptions-item label="终端Key" :span="2">{{ dataDetail?.clientKey }}</a-descriptions-item>
|
<a-descriptions-item label="终端类型" :span="2">
|
||||||
<a-descriptions-item label="终端秘钥" :span="2">{{ dataDetail?.clientSecret }}</a-descriptions-item>
|
<GiCellTag :value="dataDetail?.clientType" :dict="client_type" />
|
||||||
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="认证类型" :span="2">
|
<a-descriptions-item label="认证类型" :span="2">
|
||||||
<a-space>
|
<a-space>
|
||||||
<GiCellTag v-for="(item, index) in dataDetail?.authType" :key="index" :value="item" :dict="auth_type_enum" />
|
<GiCellTag v-for="(item, index) in dataDetail?.authType" :key="index" :value="item" :dict="auth_type_enum" />
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="终端类型" :span="2">
|
|
||||||
<GiCellTag :value="dataDetail?.clientType" :dict="client_type" />
|
|
||||||
</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="Token最低活跃频率">{{ dataDetail?.activeTimeout }}</a-descriptions-item>
|
<a-descriptions-item label="Token最低活跃频率">{{ dataDetail?.activeTimeout }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="Token有效期">{{ dataDetail?.timeout }}</a-descriptions-item>
|
<a-descriptions-item label="Token有效期">{{ dataDetail?.timeout }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="状态" :span="2">
|
<a-descriptions-item label="状态" :span="2">
|
||||||
<GiCellStatus :status="dataDetail?.status" />
|
<a-tag v-if="dataDetail?.status === 1" color="green">启用</a-tag>
|
||||||
|
<a-tag v-else color="red">禁用</a-tag>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
|
<a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="创建时间">{{ dataDetail?.createTime }}</a-descriptions-item>
|
<a-descriptions-item label="创建时间">{{ dataDetail?.createTime }}</a-descriptions-item>
|
||||||
|
@@ -5,14 +5,13 @@
|
|||||||
:data="dataList"
|
:data="dataList"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:scroll="{ x: '100%', y: '100%', minWidth: 1500 }"
|
:scroll="{ x: '100%', y: '100%', minWidth: 1200 }"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:disabled-tools="['size']"
|
:disabled-tools="['size']"
|
||||||
:disabled-column-keys="['clientKey']"
|
:disabled-column-keys="['clientKey']"
|
||||||
@refresh="search"
|
@refresh="search"
|
||||||
>
|
>
|
||||||
<template #toolbar-left>
|
<template #toolbar-left>
|
||||||
<a-input-search v-model="queryForm.clientKey" placeholder="搜索终端Key" allow-clear @search="search" />
|
|
||||||
<a-select
|
<a-select
|
||||||
v-model="queryForm.clientType"
|
v-model="queryForm.clientType"
|
||||||
:options="client_type"
|
:options="client_type"
|
||||||
@@ -83,10 +82,8 @@ const {
|
|||||||
} = useDict('client_type', 'auth_type_enum')
|
} = useDict('client_type', 'auth_type_enum')
|
||||||
|
|
||||||
const queryForm = reactive<ClientQuery>({
|
const queryForm = reactive<ClientQuery>({
|
||||||
clientKey: '',
|
|
||||||
clientSecret: '',
|
|
||||||
authType: [] as string[],
|
|
||||||
clientType: '',
|
clientType: '',
|
||||||
|
authType: [] as string[],
|
||||||
status: '',
|
status: '',
|
||||||
sort: ['id,desc'],
|
sort: ['id,desc'],
|
||||||
})
|
})
|
||||||
@@ -123,8 +120,17 @@ const columns: TableInstance['columns'] = [
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ title: '终端 Key', dataIndex: 'clientKey', slotName: 'clientKey', ellipsis: true, tooltip: true, align: 'center' },
|
{
|
||||||
{ title: '终端秘钥', dataIndex: 'clientSecret', slotName: 'clientSecret', ellipsis: true, tooltip: true, align: 'center' },
|
title: '终端类型',
|
||||||
|
dataIndex: 'clientType',
|
||||||
|
slotName: 'clientType',
|
||||||
|
ellipsis: true,
|
||||||
|
tooltip: true,
|
||||||
|
align: 'center',
|
||||||
|
render: ({ record }) => {
|
||||||
|
return <GiCellTag value={record.clientType} dict={client_type.value} />
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '认证类型',
|
title: '认证类型',
|
||||||
dataIndex: 'authType',
|
dataIndex: 'authType',
|
||||||
@@ -138,17 +144,6 @@ const columns: TableInstance['columns'] = [
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '终端类型',
|
|
||||||
dataIndex: 'clientType',
|
|
||||||
slotName: 'clientType',
|
|
||||||
ellipsis: true,
|
|
||||||
tooltip: true,
|
|
||||||
align: 'center',
|
|
||||||
render: ({ record }) => {
|
|
||||||
return <GiCellTag value={record.clientType} dict={client_type.value} />
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{ title: 'Token 最低活跃频率', dataIndex: 'activeTimeout', slotName: 'activeTimeout', width: 180, align: 'center', render: ({ record }) => `${record.activeTimeout} 秒` },
|
{ title: 'Token 最低活跃频率', dataIndex: 'activeTimeout', slotName: 'activeTimeout', width: 180, align: 'center', render: ({ record }) => `${record.activeTimeout} 秒` },
|
||||||
{ title: 'Token 有效期', dataIndex: 'timeout', slotName: 'timeout', align: 'center', render: ({ record }) => `${record.timeout} 秒` },
|
{ title: 'Token 有效期', dataIndex: 'timeout', slotName: 'timeout', align: 'center', render: ({ record }) => `${record.timeout} 秒` },
|
||||||
{
|
{
|
||||||
@@ -177,10 +172,8 @@ const columns: TableInstance['columns'] = [
|
|||||||
|
|
||||||
// 重置
|
// 重置
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
queryForm.clientKey = ''
|
|
||||||
queryForm.clientSecret = ''
|
|
||||||
queryForm.authType = []
|
|
||||||
queryForm.clientType = ''
|
queryForm.clientType = ''
|
||||||
|
queryForm.authType = []
|
||||||
queryForm.status = ''
|
queryForm.status = ''
|
||||||
search()
|
search()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user