diff --git a/yudao-admin-ui/src/main.js b/yudao-admin-ui/src/main.js index d9978300..78ab14f7 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 0f41d1f5..8fee22d0 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;