From fbaf95937087cb2b010649f62d853d9ef87e5efb Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Wed, 22 Mar 2023 11:38:09 +0000
Subject: [PATCH 01/11] add src/views/infra/apiAccessLog/ApiAccessLog.data.ts.
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
.../infra/apiAccessLog/ApiAccessLog.data.ts | 349 ++++++++++++++++++
1 file changed, 349 insertions(+)
create mode 100644 src/views/infra/apiAccessLog/ApiAccessLog.data.ts
diff --git a/src/views/infra/apiAccessLog/ApiAccessLog.data.ts b/src/views/infra/apiAccessLog/ApiAccessLog.data.ts
new file mode 100644
index 000000000..eab6e3c60
--- /dev/null
+++ b/src/views/infra/apiAccessLog/ApiAccessLog.data.ts
@@ -0,0 +1,349 @@
+import { BasicColumn, FormSchema, useRender } from '@/components/Table'
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+
+export const columns: BasicColumn[] = [
+ {
+ title: '日志主键',
+ dataIndex: 'id',
+ width: 100
+ },
+ {
+ title: '链路追踪编号',
+ dataIndex: 'traceId',
+ width: 100
+ },
+ {
+ title: '用户编号',
+ dataIndex: 'userId',
+ width: 100
+ },
+ {
+ title: '用户类型',
+ dataIndex: 'userType',
+ width: 180,
+ customRender: ({ text }) => {
+ return useRender.renderDict(text, DICT_TYPE.USER_TYPE)
+ }
+ },
+ {
+ title: '应用名',
+ dataIndex: 'applicationName',
+ width: 100
+ },
+ {
+ title: '请求方法名',
+ dataIndex: 'requestMethod',
+ width: 100
+ },
+ {
+ title: '请求地址',
+ dataIndex: 'requestUrl',
+ width: 100
+ },
+ {
+ title: '请求参数',
+ dataIndex: 'requestParams',
+ width: 100
+ },
+ {
+ title: '用户 IP',
+ dataIndex: 'userIp',
+ width: 100
+ },
+ {
+ title: '浏览器 UA',
+ dataIndex: 'userAgent',
+ width: 100
+ },
+ {
+ title: '开始请求时间',
+ dataIndex: 'beginTime',
+ width: 180,
+ customRender: ({ text }) => {
+ return useRender.renderDate(text)
+ }
+ },
+ {
+ title: '结束请求时间',
+ dataIndex: 'endTime',
+ width: 180,
+ customRender: ({ text }) => {
+ return useRender.renderDate(text)
+ }
+ },
+ {
+ title: '执行时长',
+ dataIndex: 'duration',
+ width: 100
+ },
+ {
+ title: '结果码',
+ dataIndex: 'resultCode',
+ width: 100
+ },
+ {
+ title: '结果提示',
+ dataIndex: 'resultMsg',
+ width: 100
+ },
+ {
+ title: '创建者',
+ dataIndex: 'creator',
+ width: 100
+ },
+ {
+ title: '创建时间',
+ dataIndex: 'createTime',
+ width: 180,
+ customRender: ({ text }) => {
+ return useRender.renderDate(text)
+ }
+ },
+ {
+ title: '更新者',
+ dataIndex: 'updater',
+ width: 100
+ },
+ {
+ title: '更新时间',
+ dataIndex: 'updateTime',
+ width: 180,
+ customRender: ({ text }) => {
+ return useRender.renderDate(text)
+ }
+ },
+ {
+ title: '租户编号',
+ dataIndex: 'tenantId',
+ width: 100
+ }
+]
+
+
+export const searchFormSchema: FormSchema[] = [
+ {
+ label: '日志主键',
+ field: 'id',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '链路追踪编号',
+ field: 'traceId',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '用户编号',
+ field: 'userId',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '用户类型',
+ field: 'userType',
+ component: 'Select',
+ componentProps: {
+ options: getIntDictOptions(DICT_TYPE.USER_TYPE)
+ },
+ colProps: { span: 8 }
+ },
+ {
+ label: '应用名',
+ field: 'applicationName',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '请求方法名',
+ field: 'requestMethod',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '请求地址',
+ field: 'requestUrl',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '请求参数',
+ field: 'requestParams',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '用户 IP',
+ field: 'userIp',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '浏览器 UA',
+ field: 'userAgent',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '开始请求时间',
+ field: 'beginTime',
+ component: 'RangePicker',
+ colProps: { span: 8 }
+ },
+ {
+ label: '结束请求时间',
+ field: 'endTime',
+ component: 'RangePicker',
+ colProps: { span: 8 }
+ },
+ {
+ label: '执行时长',
+ field: 'duration',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '结果码',
+ field: 'resultCode',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '结果提示',
+ field: 'resultMsg',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '创建者',
+ field: 'creator',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '创建时间',
+ field: 'createTime',
+ component: 'RangePicker',
+ colProps: { span: 8 }
+ },
+ {
+ label: '更新者',
+ field: 'updater',
+ component: 'Input',
+ colProps: { span: 8 }
+ },
+ {
+ label: '更新时间',
+ field: 'updateTime',
+ component: 'RangePicker',
+ colProps: { span: 8 }
+ },
+ {
+ label: '租户编号',
+ field: 'tenantId',
+ component: 'Input',
+ colProps: { span: 8 }
+ }
+]
+
+export const formSchema: FormSchema[] = [
+ {
+ label: '编号',
+ field: 'id',
+ show: false,
+ component: 'Input'
+ },
+ {
+ label: '链路追踪编号',
+ field: 'traceId',
+ required: true,
+ component: 'Input'
+ },
+ {
+ label: '用户编号',
+ field: 'userId',
+ required: true,
+ component: 'InputNumber'
+ },
+ {
+ label: '用户类型',
+ field: 'userType',
+ component: 'Select',
+ defaultValue: 0,
+ componentProps: {
+ options: getIntDictOptions(DICT_TYPE.USER_TYPE)
+ }
+ },
+ {
+ label: '应用名',
+ field: 'applicationName',
+ required: true,
+ component: 'Input'
+ },
+ {
+ label: '请求方法名',
+ field: 'requestMethod',
+ required: true,
+ component: 'Input'
+ },
+ {
+ label: '请求地址',
+ field: 'requestUrl',
+ required: true,
+ component: 'Input'
+ },
+ {
+ label: '请求参数',
+ field: 'requestParams',
+ required: true,
+ component: 'Input'
+ },
+ {
+ label: '用户 IP',
+ field: 'userIp',
+ required: true,
+ component: 'Input'
+ },
+ {
+ label: '浏览器 UA',
+ field: 'userAgent',
+ required: true,
+ component: 'Input'
+ },
+ {
+ label: '执行时长',
+ field: 'duration',
+ required: true,
+ component: 'InputNumber'
+ },
+ {
+ label: '结果码',
+ field: 'resultCode',
+ required: true,
+ component: 'InputNumber'
+ },
+ {
+ label: '结果提示',
+ field: 'resultMsg',
+ required: true,
+ component: 'Input'
+ },
+ {
+ label: '创建者',
+ field: 'creator',
+ required: true,
+ component: 'Input'
+ },
+ {
+ label: '更新者',
+ field: 'updater',
+ required: true,
+ component: 'Input'
+ },
+ {
+ label: '租户编号',
+ field: 'tenantId',
+ required: true,
+ component: 'InputNumber'
+ }
+]
--
Gitee
From b7c445849985693456cd08f119210cb59e82e409 Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Wed, 22 Mar 2023 11:38:42 +0000
Subject: [PATCH 02/11] update src/views/infra/apiAccessLog/index.vue.
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
src/views/infra/apiAccessLog/index.vue | 96 +++++++++++++++++++++++++-
1 file changed, 95 insertions(+), 1 deletion(-)
diff --git a/src/views/infra/apiAccessLog/index.vue b/src/views/infra/apiAccessLog/index.vue
index 3b64cfc4f..7813f5fd7 100644
--- a/src/views/infra/apiAccessLog/index.vue
+++ b/src/views/infra/apiAccessLog/index.vue
@@ -1,3 +1,97 @@
- 开发中
+
+
+
+ 新增
+ 导出
+
+
+
+
+
+
+
+
+
+
--
Gitee
From 6d1a518bb56eab7e055be3956d140eb323b9b7a8 Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Wed, 22 Mar 2023 11:39:29 +0000
Subject: [PATCH 03/11] add src/views/infra/apiAccessLog/ApiAccessLogModel.vue.
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
.../infra/apiAccessLog/ApiAccessLogModel.vue | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
create mode 100644 src/views/infra/apiAccessLog/ApiAccessLogModel.vue
diff --git a/src/views/infra/apiAccessLog/ApiAccessLogModel.vue b/src/views/infra/apiAccessLog/ApiAccessLogModel.vue
new file mode 100644
index 000000000..f9d4e441b
--- /dev/null
+++ b/src/views/infra/apiAccessLog/ApiAccessLogModel.vue
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+import { ref, computed, unref } from 'vue'
+import { BasicModal, useModalInner } from '@/components/Modal'
+import { BasicForm, useForm } from '@/components/Form'
+import { formSchema } from './ApiAccessLog.data'
+import { createApiAccessLogApi, getApiAccessLogApi, updatePostApi } from '@/api/infra/apiAccessLog'
+
+const emit = defineEmits(['success', 'register'])
+const isUpdate = ref(true)
+const rowId = ref()
+
+const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
+ labelWidth: 100,
+ baseColProps: { span: 24 },
+ schemas: formSchema,
+ showActionButtonGroup: false,
+ actionColOptions: {
+ span: 23
+ }
+})
+
+const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
+ resetFields()
+ setModalProps({ confirmLoading: false })
+ isUpdate.value = !!data?.isUpdate
+
+ if (unref(isUpdate)) {
+ const res = await getApiAccessLogApi(data.record.id)
+ rowId.value = res.id
+ setFieldsValue({
+ ...res
+ })
+ }
+})
+
+const getTitle = computed(() => (!unref(isUpdate) ? '新增API访问日志表' : '编辑API访问日志表'))
+
+async function handleSubmit() {
+ try {
+ const values = await validate()
+ setModalProps({ confirmLoading: true })
+ if (unref(isUpdate)) {
+ await updateApiAccessLogApi(values)
+ } else {
+ await createApiAccessLogApi(values)
+ }
+ closeModal()
+ emit('success')
+ } finally {
+ setModalProps({ confirmLoading: false })
+ }
+}
+
--
Gitee
From 5831ca39bb844c198f101a37da55cbfe244c3c0f Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Wed, 22 Mar 2023 11:40:49 +0000
Subject: [PATCH 04/11] =?UTF-8?q?update=20src/api/infra/apiAccessLog/index?=
=?UTF-8?q?.ts.=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E4=B8=80=E4=B8=AA=20=20?=
=?UTF-8?q?=E5=88=A0=E9=99=A4APIACCESSLOG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
src/api/infra/apiAccessLog/index.ts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/api/infra/apiAccessLog/index.ts b/src/api/infra/apiAccessLog/index.ts
index 722ab8040..d9db06efe 100644
--- a/src/api/infra/apiAccessLog/index.ts
+++ b/src/api/infra/apiAccessLog/index.ts
@@ -44,6 +44,11 @@ export const getApiAccessLogPageApi = (params: ApiAccessLogPageReqVO) => {
return defHttp.get({ url: '/infra/api-access-log/page', params })
}
+// 删除APIACCESSLOG
+export const deleteApiAccessLogApi = (id: number) => {
+ return defHttp.delete({ url: '/infra/api-access-log/delete?id=' + id })
+}
+
// 导出API 访问日志
export const exportApiAccessLogApi = (params: ApiAccessLogExportReqVO) => {
return defHttp.download({ url: '/infra/api-access-log/export-excel', params }, '访问日志.xls')
--
Gitee
From c1f727708f4252ee3f54b5586aee71386710a982 Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Thu, 23 Mar 2023 02:00:51 +0000
Subject: [PATCH 05/11] update
src/views/infra/apiAccessLog/ApiAccessLogModel.vue.
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
src/views/infra/apiAccessLog/ApiAccessLogModel.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/infra/apiAccessLog/ApiAccessLogModel.vue b/src/views/infra/apiAccessLog/ApiAccessLogModel.vue
index f9d4e441b..39020e737 100644
--- a/src/views/infra/apiAccessLog/ApiAccessLogModel.vue
+++ b/src/views/infra/apiAccessLog/ApiAccessLogModel.vue
@@ -4,7 +4,7 @@
-
+
+
\ No newline at end of file
--
Gitee
From 7ea86313d06376d36d47e1280683ddef59427cba Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Thu, 23 Mar 2023 02:01:23 +0000
Subject: [PATCH 06/11] update src/views/infra/apiAccessLog/index.vue.
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
src/views/infra/apiAccessLog/index.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/infra/apiAccessLog/index.vue b/src/views/infra/apiAccessLog/index.vue
index 7813f5fd7..d16d4fcc9 100644
--- a/src/views/infra/apiAccessLog/index.vue
+++ b/src/views/infra/apiAccessLog/index.vue
@@ -94,4 +94,4 @@ async function handleDelete(record: Recordable) {
reload()
}
-
+
\ No newline at end of file
--
Gitee
From a87ace731e4d72af2e80ec3947e47b652ad22e8f Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Thu, 23 Mar 2023 02:01:55 +0000
Subject: [PATCH 07/11] update
src/views/infra/apiAccessLog/ApiAccessLog.data.ts.
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
src/views/infra/apiAccessLog/ApiAccessLog.data.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/infra/apiAccessLog/ApiAccessLog.data.ts b/src/views/infra/apiAccessLog/ApiAccessLog.data.ts
index eab6e3c60..72c608423 100644
--- a/src/views/infra/apiAccessLog/ApiAccessLog.data.ts
+++ b/src/views/infra/apiAccessLog/ApiAccessLog.data.ts
@@ -346,4 +346,4 @@ export const formSchema: FormSchema[] = [
required: true,
component: 'InputNumber'
}
-]
+]
\ No newline at end of file
--
Gitee
From 4115d7f7baaa62f270959f5c28da426ea1055dab Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Thu, 23 Mar 2023 02:03:08 +0000
Subject: [PATCH 08/11] update src/api/infra/apiAccessLog/index.ts.
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
src/api/infra/apiAccessLog/index.ts | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/api/infra/apiAccessLog/index.ts b/src/api/infra/apiAccessLog/index.ts
index d9db06efe..a05541d54 100644
--- a/src/api/infra/apiAccessLog/index.ts
+++ b/src/api/infra/apiAccessLog/index.ts
@@ -39,6 +39,16 @@ export interface ApiAccessLogExportReqVO {
resultCode?: number
}
+// 新增列表API 访问日志
+export const createApiAccessLogApi = (data: ApiAccessLogVO) => {
+ return defHttp.post({ url: '/infra/api-access-log/create', data })
+}
+//getApiAccessLogApi
+// 查询API 访问日志
+export const getApiAccessLogApi = (id: number) => {
+ return defHttp.get({ url: '/infra/api-access-log/get?id=' + id })
+}
+
// 查询列表API 访问日志
export const getApiAccessLogPageApi = (params: ApiAccessLogPageReqVO) => {
return defHttp.get({ url: '/infra/api-access-log/page', params })
--
Gitee
From 54f97dcbc31fca1a96a63ec67a5b8f6da54a84b0 Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Thu, 23 Mar 2023 23:55:05 +0000
Subject: [PATCH 09/11] update src/views/infra/apiAccessLog/index.vue.
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
src/views/infra/apiAccessLog/index.vue | 126 +++++++++++--------------
1 file changed, 53 insertions(+), 73 deletions(-)
diff --git a/src/views/infra/apiAccessLog/index.vue b/src/views/infra/apiAccessLog/index.vue
index d16d4fcc9..ce4fb3958 100644
--- a/src/views/infra/apiAccessLog/index.vue
+++ b/src/views/infra/apiAccessLog/index.vue
@@ -1,40 +1,34 @@
-
-
-
- 新增
- 导出
-
-
-
-
-
-
-
-
-
+
+
+
+ 导出
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+
--
Gitee
From 441a79e90924c001b81753e743eb2f895b782938 Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Thu, 23 Mar 2023 23:55:44 +0000
Subject: [PATCH 10/11] update
src/views/infra/apiAccessLog/ApiAccessLogModel.vue.
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
.../infra/apiAccessLog/ApiAccessLogModel.vue | 73 ++++++++-----------
1 file changed, 32 insertions(+), 41 deletions(-)
diff --git a/src/views/infra/apiAccessLog/ApiAccessLogModel.vue b/src/views/infra/apiAccessLog/ApiAccessLogModel.vue
index 39020e737..075ae9f3d 100644
--- a/src/views/infra/apiAccessLog/ApiAccessLogModel.vue
+++ b/src/views/infra/apiAccessLog/ApiAccessLogModel.vue
@@ -1,60 +1,51 @@
-
-
-
-
-
-
\ No newline at end of file
+
--
Gitee
From 5ab69d3dc4825bcadf6651de7ab32e7b6e80e737 Mon Sep 17 00:00:00 2001
From: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
Date: Thu, 23 Mar 2023 23:57:29 +0000
Subject: [PATCH 11/11] update src/api/infra/apiAccessLog/index.ts.
Signed-off-by: yanchangshan <5333290+yanchangshan@user.noreply.gitee.com>
---
src/api/infra/apiAccessLog/index.ts | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/src/api/infra/apiAccessLog/index.ts b/src/api/infra/apiAccessLog/index.ts
index a05541d54..d9db06efe 100644
--- a/src/api/infra/apiAccessLog/index.ts
+++ b/src/api/infra/apiAccessLog/index.ts
@@ -39,16 +39,6 @@ export interface ApiAccessLogExportReqVO {
resultCode?: number
}
-// 新增列表API 访问日志
-export const createApiAccessLogApi = (data: ApiAccessLogVO) => {
- return defHttp.post({ url: '/infra/api-access-log/create', data })
-}
-//getApiAccessLogApi
-// 查询API 访问日志
-export const getApiAccessLogApi = (id: number) => {
- return defHttp.get({ url: '/infra/api-access-log/get?id=' + id })
-}
-
// 查询列表API 访问日志
export const getApiAccessLogPageApi = (params: ApiAccessLogPageReqVO) => {
return defHttp.get({ url: '/infra/api-access-log/page', params })
--
Gitee