From 743f42bc172cd86593f0c02a861e5b7113b0aae6 Mon Sep 17 00:00:00 2001
From: wangxiang <1827945911@qq.com>
Date: Mon, 9 May 2022 06:49:12 +0800
Subject: [PATCH] =?UTF-8?q?=F0=9F=91=A3=20=E7=BC=96=E5=86=99=E5=9F=BA?=
=?UTF-8?q?=E7=A1=80=E6=97=A5=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
kicc-ui/src/views/monitor/operLog/index.vue | 2 -
.../src/views/monitor/token/ClientModal.vue | 102 -----------
.../src/views/monitor/token/client.data.ts | 164 ------------------
kicc-ui/src/views/monitor/token/index.vue | 100 ++---------
kicc-ui/src/views/monitor/token/token.data.ts | 36 ++++
5 files changed, 51 insertions(+), 353 deletions(-)
delete mode 100644 kicc-ui/src/views/monitor/token/ClientModal.vue
delete mode 100644 kicc-ui/src/views/monitor/token/client.data.ts
create mode 100644 kicc-ui/src/views/monitor/token/token.data.ts
diff --git a/kicc-ui/src/views/monitor/operLog/index.vue b/kicc-ui/src/views/monitor/operLog/index.vue
index 67126a01..4ee6ef3e 100644
--- a/kicc-ui/src/views/monitor/operLog/index.vue
+++ b/kicc-ui/src/views/monitor/operLog/index.vue
@@ -39,7 +39,6 @@
import { reactive, toRaw } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listOperLog, delOperLog, cleanOperLog } from '/@/api/platform/monitor/controller/operLog';
- import { useModal } from '/@/components/Modal';
import { columns, searchFormSchema } from './operLog.data';
import { useMessage } from '/@/hooks/web/useMessage';
@@ -57,7 +56,6 @@
multiple: true
});
const { createConfirm, createMessage } = useMessage();
- const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '操作日志列表',
api: listOperLog,
diff --git a/kicc-ui/src/views/monitor/token/ClientModal.vue b/kicc-ui/src/views/monitor/token/ClientModal.vue
deleted file mode 100644
index 57a9b0de..00000000
--- a/kicc-ui/src/views/monitor/token/ClientModal.vue
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
-
diff --git a/kicc-ui/src/views/monitor/token/client.data.ts b/kicc-ui/src/views/monitor/token/client.data.ts
deleted file mode 100644
index 3667fb86..00000000
--- a/kicc-ui/src/views/monitor/token/client.data.ts
+++ /dev/null
@@ -1,164 +0,0 @@
-/**
- * @program: kicc-ui
- * @description: 多租户模块动态渲染配置
- * @author: entfrm开发团队-王翔
- * @create: 2022/4/21
- */
-
-import { BasicColumn } from '/@/components/Table';
-import { FormSchema } from '/@/components/Table';
-
-/** 表格列配置 */
-export const columns: BasicColumn[] = [
- {
- title: '客户端Id',
- dataIndex: 'clientId',
- width: 100
- },
- {
- title: '客户端密钥',
- dataIndex: 'clientSecret',
- width: 100
- },
- {
- title: '授权类型',
- dataIndex: 'authorizedGrantTypes',
- width: 130
- },
- {
- title: '授权范围',
- dataIndex: 'scope',
- width: 90
- },
- {
- title: '令牌过期秒数',
- dataIndex: 'accessTokenValidity',
- width: 130
- },
- {
- title: '令牌过期秒数',
- dataIndex: 'refreshTokenValidity',
- width: 130
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- width: 100
- }
-];
-
-/** 搜索表单配置 */
-export const searchFormSchema: FormSchema[] = [
- {
- field: 'clientId',
- label: '客户端编码',
- component: 'Input',
- componentProps: {
- placeholder: '请输入客户端编码',
- },
- colProps: { span: 8 },
- },
- {
- field: 'dateRange',
- label: '创建时间',
- component: 'RangePicker',
- componentProps: {
- style: { width:'100%' },
- valueFormat: 'YYYY-MM-DD',
- placeholder: ['开始日期','结束日期']
- },
- colProps: { span: 8 }
- }
-];
-
-/** 表单配置 */
-export const formSchema: FormSchema[] = [
- {
- field: 'id',
- label: 'ID',
- component: 'Input',
- show: false
- },
- {
- field: 'clientId',
- label: '客户端Id',
- component: 'Input',
- required: true,
- colProps: {
- span: 12
- }
- },
- {
- field: 'clientSecret',
- label: '客户端密钥',
- component: 'Input',
- required: true,
- colProps: {
- span: 12
- }
- },
- {
- field: 'authorizedGrantTypes',
- label: '授权类型',
- component: 'InputTextArea',
- required:true,
- componentProps: {
- rows: 3
- },
- colProps: {
- span: 24
- }
- },
- {
- field: 'scope',
- label: '授权范围',
- component: 'Input',
- required:true,
- colProps: {
- span: 12
- }
- },
- {
- field: 'accessTokenValidity',
- label: '过期秒数',
- component: 'InputNumber',
- componentProps: {
- style: { width:'100%' },
- min: 0
- },
- colProps: {
- span: 12
- }
- },
- {
- field: 'refreshTokenValidity',
- label: '刷新秒数',
- component: 'InputNumber',
- componentProps: {
- style: { width:'100%' },
- min: 0
- },
- colProps: {
- span: 12
- }
- },
- {
- field: 'webServerRedirectUri',
- label: '回调地址',
- component: 'Input',
- colProps: {
- span: 12
- }
- },
- {
- field: 'additionalInformation',
- label: '附加说明',
- component: 'InputTextArea',
- componentProps: {
- rows: 6
- },
- colProps: {
- span: 24
- }
- }
-];
diff --git a/kicc-ui/src/views/monitor/token/index.vue b/kicc-ui/src/views/monitor/token/index.vue
index 520de351..4ffc7046 100644
--- a/kicc-ui/src/views/monitor/token/index.vue
+++ b/kicc-ui/src/views/monitor/token/index.vue
@@ -1,32 +1,8 @@
-
-
- 新增客户端
- 修改客户端
- 删除客户端
-
+
@@ -49,84 +23,41 @@
* Copyright © 2020-2022 entfrm All rights reserved.
* author entfrm开发团队-王翔
*/
- import { reactive, toRaw } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
- import { listClient, delClient } from '/@/api/platform/system/controller/client';
- import { useModal } from '/@/components/Modal';
- import ClientModal from './ClientModal.vue';
- import { columns, searchFormSchema } from './client.data';
+ import { listToken, delToken } from '/@/api/platform/monitor/controller/token';
+ import { columns } from './token.data';
import { useMessage } from '/@/hooks/web/useMessage';
- /** 类型规范统一声明定义区域 */
- interface TableState {
- single: boolean;
- multiple: boolean;
- }
-
- /** 通用变量统一声明区域 */
- const state = reactive({
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true
- });
const { createConfirm, createMessage } = useMessage();
- const [registerModal, { openModal }] = useModal();
- const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
- title: '客户端列表',
- api: listClient,
- rowKey: 'clientId',
+ const [registerTable, { reload }] = useTable({
+ title: '令牌列表',
+ api: listToken,
columns,
- formConfig: {
- labelWidth: 120,
- schemas: searchFormSchema,
- autoSubmitOnEnter: true,
- fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']]
- },
- rowSelection: { type: 'checkbox' },
- useSearchForm: true,
showTableSetting: true,
bordered: true,
- clickToRowSelect: false,
showIndexColumn: false,
+ tableSetting: {
+ fullScreen: true
+ },
actionColumn: {
- width: 220,
+ width: 120,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
fixed: false
- },
- handleSearchInfoFn: () => clearSelectedRowKeys()
+ }
});
- /** 处理多选框选中数据 */
- function handleSelectionChange(selection?: Recordable) {
- const rowSelection = toRaw(selection?.keys) || [];
- state.single = rowSelection.length != 1;
- state.multiple = !rowSelection.length;
- }
-
- /** 新增按钮操作,行内新增与工具栏局域新增通用 */
- function handleAdd() {
- openModal(true,{ _tag: 'add' });
- }
-
- /** 编辑按钮操作,行内编辑 */
- function handleEdit(record?: Recordable) {
- record = record || { clientId: getSelectRowKeys() };
- openModal(true, { _tag: 'edit', record });
- }
-
/** 删除按钮操作,行内删除 */
async function handleDel(record?: Recordable) {
- const clientIds = record?.clientId || getSelectRowKeys();
+ const access_token = record?.access_token;
createConfirm({
iconType: 'warning',
title: '警告',
- content: `是否确认删除客户端编号为${clientIds}客户端吗?`,
+ content: `是否强制${access_token}下线?`,
onOk: async () => {
- await delClient(clientIds);
- createMessage.success('删除成功!');
+ await delToken(access_token);
+ createMessage.success('下线成功!');
handleRefreshTable();
}
});
@@ -134,7 +65,6 @@
/** 处理表格刷新 */
function handleRefreshTable() {
- clearSelectedRowKeys();
reload();
}
diff --git a/kicc-ui/src/views/monitor/token/token.data.ts b/kicc-ui/src/views/monitor/token/token.data.ts
new file mode 100644
index 00000000..635683bd
--- /dev/null
+++ b/kicc-ui/src/views/monitor/token/token.data.ts
@@ -0,0 +1,36 @@
+/**
+ * @program: kicc-ui
+ * @description: 令牌模块动态渲染配置
+ * @author: entfrm开发团队-王翔
+ * @create: 2022/4/21
+ */
+
+import { BasicColumn } from '/@/components/Table';
+
+/** 表格列配置 */
+export const columns: BasicColumn[] = [
+ {
+ title: '用户编号',
+ dataIndex: 'user_info.id'
+ },
+ {
+ title: '用户名称',
+ dataIndex: 'user_info.username'
+ },
+ {
+ title: '客户端',
+ dataIndex: 'clientId'
+ },
+ {
+ title: '令牌',
+ dataIndex: 'access_token'
+ },
+ {
+ title: '类型',
+ dataIndex: 'token_type'
+ },
+ {
+ title: '过期时间',
+ dataIndex: 'expires_in'
+ }
+];