log文件引用报错处理,本地代理配置

This commit is contained in:
zxy
2024-02-04 13:38:23 +08:00
parent 7aec486f06
commit ef8cf0773c
3 changed files with 1805 additions and 2377 deletions

4118
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +1,26 @@
<template> <template>
<span @click="logsFlag?'':handleOpen()"> <span @click="logsFlag ? '' : handleOpen()">
<el-badge :value="logsFlag?'':logsLen" <el-badge :value="logsFlag ? '' : logsLen" :max="99">
:max="99">
<i class="icon-rizhi1"></i> <i class="icon-rizhi1"></i>
</el-badge> </el-badge>
<el-dialog title="日志" <el-dialog
fullscreen title="日志"
:visible.sync="box" fullscreen
width="100%" :visible.sync="box"
append-to-body> width="100%"
<logs></logs> append-to-body
>
<!-- <logs></logs> -->
</el-dialog> </el-dialog>
</span> </span>
</template> </template>
<script> <script>
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import logs from "@/page/logs/index"; // import logs from "@/page/logs/index";
export default { export default {
name: "top-logs", name: "top-logs",
components: { logs }, // components: { logs },
data() { data() {
return { return {
box: false box: false
@@ -39,5 +40,4 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

View File

@@ -1,40 +1,42 @@
module.exports = { module.exports = {
//路径前缀 //路径前缀
publicPath: '/manage/', publicPath: "/manage/",
outputDir: 'dist', outputDir: "dist",
lintOnSave: true, lintOnSave: true,
productionSourceMap: false, productionSourceMap: false,
chainWebpack: (config) => { chainWebpack: config => {
//忽略的打包文件 //忽略的打包文件
config.externals({ config.externals({
'vue': 'Vue', vue: "Vue",
'vue-router': 'VueRouter', "vue-router": "VueRouter",
'vuex': 'Vuex', vuex: "Vuex",
'axios': 'axios', axios: "axios",
'element-ui': 'ELEMENT', "element-ui": "ELEMENT"
}); });
const entry = config.entry('app'); const entry = config.entry("app");
entry.add('babel-polyfill').end(); entry.add("babel-polyfill").end();
entry.add('classlist-polyfill').end(); entry.add("classlist-polyfill").end();
entry.add('@/mock').end(); entry.add("@/mock").end();
}, },
devServer: { devServer: {
host: "0.0.0.0",
port: 1888, port: 1888,
proxy: { proxy: {
'/api': { "/api": {
//本地服务接口地址 //本地服务接口地址
target: 'http://localhost:8000', target: "http://192.168.31.246:8000",
ws: true, ws: true,
changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/api': '/' "^/api": "/"
} }
}, },
'/api/map': { "/api/map": {
//本地服务接口地址 //本地服务接口地址
target: 'http://apis.map.qq.com', target: "http://apis.map.qq.com",
ws: true, ws: true,
pathRewrite: { pathRewrite: {
'^/api/map': '/' "^/api/map": "/"
} }
} }
} }