chore: 客户端管理 => 终端管理

This commit is contained in:
2025-02-26 21:24:16 +08:00
parent 75f671d891
commit dc6e0a4ff6
8 changed files with 29 additions and 29 deletions

View File

@@ -17,5 +17,5 @@ VITE_OPEN_DEVTOOLS = false
# 应用配置面板
VITE_APP_SETTING = true
# 客户端ID
# 端ID
VITE_CLIENT_ID = 'ef51c9a3e9046c4f2ea45142c8a8344a'

View File

@@ -13,5 +13,5 @@ VITE_BASE = '/'
# 应用配置面板
VITE_APP_SETTING = true
# 客户端ID
# 端ID
VITE_CLIENT_ID = 'ef51c9a3e9046c4f2ea45142c8a8344a'

View File

@@ -18,5 +18,5 @@ VITE_OPEN_DEVTOOLS = true
# 应用配置面板
VITE_APP_SETTING = false
# 客户端ID
# 端ID
VITE_CLIENT_ID = 'ef51c9a3e9046c4f2ea45142c8a8344a'

View File

@@ -5,27 +5,27 @@ export type * from './type'
const BASE_URL = '/system/client'
/** @desc 查询客户端列表 */
/** @desc 查询端列表 */
export function listClient(query: T.ClientPageQuery) {
return http.get<PageRes<T.ClientResp[]>>(`${BASE_URL}`, query)
}
/** @desc 查询客户端详情 */
/** @desc 查询端详情 */
export function getClient(id: string) {
return http.get<T.ClientDetailResp>(`${BASE_URL}/${id}`)
}
/** @desc 新增客户端 */
/** @desc 新增端 */
export function addClient(data: any) {
return http.post(`${BASE_URL}`, data)
}
/** @desc 修改客户端 */
/** @desc 修改端 */
export function updateClient(data: any, id: string) {
return http.put(`${BASE_URL}/${id}`, data)
}
/** @desc 删除客户端 */
/** @desc 删除端 */
export function deleteClient(ids: string | Array<string>) {
return http.del(`${BASE_URL}/${ids}`)
}

View File

@@ -259,7 +259,7 @@ export interface StorageQuery {
export interface StoragePageQuery extends StorageQuery, PageQuery {
}
/** 客户端类型 */
/** 端类型 */
export interface ClientResp {
id: string
clientId: string

View File

@@ -32,7 +32,7 @@ const { width } = useWindowSize()
const dataId = ref('')
const visible = ref(false)
const isUpdate = computed(() => !!dataId.value)
const title = computed(() => (isUpdate.value ? '修改客户端' : '新增客户端'))
const title = computed(() => (isUpdate.value ? '修改端' : '新增端'))
const formRef = ref<InstanceType<typeof GiForm>>()
const { client_type, auth_type_enum } = useDict('auth_type_enum', 'client_type')
@@ -56,20 +56,20 @@ const handleGenerate = () => {
const columns: Columns = reactive([
{
label: '客户端 Key',
label: '端 Key',
field: 'clientKey',
type: 'input',
rules: [{ required: true, message: '请输入客户端 Key' }],
rules: [{ required: true, message: '请输入端 Key' }],
span: 2,
disabled: () => {
return isUpdate.value
},
},
{
label: '客户端秘钥',
label: '端秘钥',
field: 'clientSecret',
type: 'input',
rules: [{ required: true, message: '请输入客户端秘钥' }],
rules: [{ required: true, message: '请输入端秘钥' }],
span: 2,
disabled: () => {
return isUpdate.value
@@ -97,11 +97,11 @@ const columns: Columns = reactive([
rules: [{ required: true, message: '请选择认证类型' }],
},
{
label: '客户端类型',
label: '端类型',
field: 'clientType',
type: 'select',
options: client_type,
rules: [{ required: true, message: '请选择客户端类型' }],
rules: [{ required: true, message: '请选择端类型' }],
},
{
label: () => (

View File

@@ -1,16 +1,16 @@
<template>
<a-drawer v-model:visible="visible" title="客户端详情" :width="width >= 600 ? 600 : '100%'" :footer="false">
<a-drawer v-model:visible="visible" title="端详情" :width="width >= 600 ? 600 : '100%'" :footer="false">
<a-descriptions :column="1" size="large" class="general-description">
<a-descriptions-item label="ID">{{ dataDetail?.id }}</a-descriptions-item>
<a-descriptions-item label="客户端ID"><a-typography-paragraph :copyable="!!dataDetail?.clientId">{{ dataDetail?.clientId }}</a-typography-paragraph></a-descriptions-item>
<a-descriptions-item label="客户端Key">{{ dataDetail?.clientKey }}</a-descriptions-item>
<a-descriptions-item label="客户端秘钥">{{ dataDetail?.clientSecret }}</a-descriptions-item>
<a-descriptions-item label="端ID"><a-typography-paragraph :copyable="!!dataDetail?.clientId">{{ dataDetail?.clientId }}</a-typography-paragraph></a-descriptions-item>
<a-descriptions-item label="端Key">{{ dataDetail?.clientKey }}</a-descriptions-item>
<a-descriptions-item label="端秘钥">{{ dataDetail?.clientSecret }}</a-descriptions-item>
<a-descriptions-item label="认证类型">
<a-space>
<GiCellTag v-for="(item, index) in dataDetail?.authType" :key="index" :value="item" :dict="auth_type_enum" />
</a-space>
</a-descriptions-item>
<a-descriptions-item label="客户端类型">
<a-descriptions-item label="端类型">
<GiCellTag :value="dataDetail?.clientType" :dict="client_type" />
</a-descriptions-item>
<a-descriptions-item label="Token最低活跃频率">{{ dataDetail?.activeTimeout }}</a-descriptions-item>

View File

@@ -13,12 +13,12 @@
@refresh="search"
>
<template #toolbar-left>
<a-input-search v-model="queryForm.clientKey" placeholder="搜索客户端Key" allow-clear @search="search" />
<a-input-search v-model="queryForm.clientSecret" placeholder="搜索客户端秘钥" allow-clear @search="search" />
<a-input-search v-model="queryForm.clientKey" placeholder="搜索端Key" allow-clear @search="search" />
<a-input-search v-model="queryForm.clientSecret" placeholder="搜索端秘钥" allow-clear @search="search" />
<a-select
v-model="queryForm.clientType"
:options="client_type"
placeholder="请选择客户端类型"
placeholder="请选择端类型"
allow-clear
style="width: 160px"
@change="search"
@@ -114,7 +114,7 @@ const columns: TableInstanceColumns[] = [
fixed: !isMobile() ? 'left' : undefined,
},
{
title: '客户端 ID',
title: '端 ID',
dataIndex: 'clientId',
slotName: 'clientId',
ellipsis: true,
@@ -125,8 +125,8 @@ const columns: TableInstanceColumns[] = [
)
},
},
{ title: '客户端 Key', dataIndex: 'clientKey', slotName: 'clientKey', ellipsis: true, tooltip: true, align: 'center' },
{ title: '客户端秘钥', dataIndex: 'clientSecret', slotName: 'clientSecret', ellipsis: true, tooltip: true, align: 'center' },
{ 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: 'authType',
@@ -141,7 +141,7 @@ const columns: TableInstanceColumns[] = [
},
},
{
title: '客户端类型',
title: '端类型',
dataIndex: 'clientType',
slotName: 'clientType',
ellipsis: true,
@@ -190,7 +190,7 @@ const reset = () => {
// 删除
const onDelete = (record: ClientResp) => {
return handleDelete(() => deleteClient(record.id), {
content: `是否确定删除客户端「${record.clientKey}(${record.clientId})」?`,
content: `是否确定删除端「${record.clientKey}(${record.clientId})」?`,
showModal: true,
})
}