diff --git a/web/build.config.js b/web/build.config.js index 17b496f7..8aafcb5e 100644 --- a/web/build.config.js +++ b/web/build.config.js @@ -2,6 +2,8 @@ module.exports = { title: 'GIN-VUE-ADMIN1', + vueClientPort: 8080, + goServerPort: 8888, baseCdnUrl: '//cdn.staticfile.org', cdns: [ /** diff --git a/web/src/main.js b/web/src/main.js index 3634e314..ba77a1aa 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -43,13 +43,14 @@ export default new Vue({ //引入echarts import echarts from 'echarts' +import buildConfig from '../build.config'; Vue.prototype.$echarts = echarts; console.log(` 欢迎使用 Gin-Vue-Admin 当前版本:V2.4.0 加群方式:微信:shouzi_1994 QQ群:622360840 - 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html - 默认前端文件运行地址:http://127.0.0.1:8080 + 默认自动化文档地址:http://127.0.0.1:` + buildConfig.goServerPort + `/swagger/index.html + 默认前端文件运行地址:http://127.0.0.1:`+ buildConfig.vueClientPort + ` 如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/docs/coffee `) \ No newline at end of file diff --git a/web/src/view/systemTools/formCreate/index.vue b/web/src/view/systemTools/formCreate/index.vue index be4574b6..2b57c084 100644 --- a/web/src/view/systemTools/formCreate/index.vue +++ b/web/src/view/systemTools/formCreate/index.vue @@ -1,6 +1,6 @@ @@ -10,6 +10,7 @@ export default { name:"FormGenerator", data(){ return{ + url:'http://127.0.0.1:' + buildConf.goServerPort + '/form-generator/#/', basePath:path } }, diff --git a/web/vue.config.js b/web/vue.config.js index 6608839b..1445ad1e 100644 --- a/web/vue.config.js +++ b/web/vue.config.js @@ -15,7 +15,7 @@ module.exports = { lintOnSave: process.env.NODE_ENV === 'development', productionSourceMap: false, devServer: { - port: 8080, + port: buildConf.vueClientPort, open: true, overlay: { warnings: false, @@ -25,7 +25,7 @@ module.exports = { // 把key的路径代理到target位置 // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { //需要代理的路径 例如 '/api' - target: `http://127.0.0.1:8888/`, //代理到 目标路径 + target: `http://127.0.0.1:` + buildConf.port + `/`, //代理到 目标路径 changeOrigin: true, pathRewrite: { // 修改路径数据 ['^' + process.env.VUE_APP_BASE_API]: '' // 举例 '^/api:""' 把路径中的/api字符串删除