From 102cafa9a64b3e24d8ac2eb847c08188e6a97742 Mon Sep 17 00:00:00 2001 From: shiyidong Date: Wed, 12 May 2021 01:09:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=87=BAvue=20component=20=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=BC=80=E5=85=B3=E6=8C=89=E9=92=AE=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-admin-ui/src/main.js | 3 +- .../src/views/infra/apiAccessLog/index.vue | 28 ++++--------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/yudao-admin-ui/src/main.js b/yudao-admin-ui/src/main.js index d9978300cb..78ab14f775 100644 --- a/yudao-admin-ui/src/main.js +++ b/yudao-admin-ui/src/main.js @@ -37,7 +37,7 @@ import RightToolbar from "@/components/RightToolbar" // import hljs from 'highlight.js' // import 'highlight.js/styles/github-gist.css' import {DICT_TYPE, getDictDataLabel, getDictDatas} from "@/utils/dict"; - +import { InfConfigKeyEnum } from '@/utils/constants'; // 全局方法挂载 Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey @@ -49,6 +49,7 @@ Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.getDictDatas = getDictDatas Vue.prototype.getDictDataLabel = getDictDataLabel Vue.prototype.DICT_TYPE = DICT_TYPE +Vue.prototype.InfConfigKeyEnum = InfConfigKeyEnum Vue.prototype.download = download Vue.prototype.downloadExcel = downloadExcel Vue.prototype.downloadWord = downloadWord diff --git a/yudao-admin-ui/src/views/infra/apiAccessLog/index.vue b/yudao-admin-ui/src/views/infra/apiAccessLog/index.vue index 0f41d1f5e1..8fee22d00d 100644 --- a/yudao-admin-ui/src/views/infra/apiAccessLog/index.vue +++ b/yudao-admin-ui/src/views/infra/apiAccessLog/index.vue @@ -37,8 +37,10 @@ - {{enable?'关闭日志':'开启日志'}} + + import { getApiAccessLogPage, exportApiAccessLogExcel } from "@/api/infra/apiAccessLog"; -import { getConfigKey,updateValueByKey } from "@/api/infra/config"; -import { InfConfigKeyEnum } from "@/utils/constants"; +import LogSwitch from "@/components/LogSwitch"; export default { name: "ApiAccessLog", components: { + LogSwitch }, data() { return { @@ -130,8 +132,6 @@ export default { loading: true, // 显示搜索条件 showSearch: true, - // 是否开启 - enable: false, // 总条数 total: 0, // API 访问日志列表 @@ -157,25 +157,9 @@ export default { }; }, created() { - this.getEnableConfig(); this.getList(); }, methods: { - //开启关闭日志 - enableHandler(){ - let data = new FormData(); - data.append("key",InfConfigKeyEnum.API_LOG_KEY); - data.append("value",this.enable?false:true); - updateValueByKey(data).then(response => { - this.msgSuccess(this.enable?"关闭成功":"开启成功"); - this.getEnableConfig(); - }) - }, - getEnableConfig(){ - getConfigKey(InfConfigKeyEnum.API_LOG_KEY).then(response => { - this.enable = (response.data == "true"); - }) - }, /** 查询列表 */ getList() { this.loading = true;