Skip to content

Commit bffe222

Browse files
author
奇淼(piexlmax
authored
Merge pull request #396 from joewan/test_branch
端口统一配置
2 parents e49bd51 + ceb5b9e commit bffe222

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

web/build.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module.exports = {
44
title: 'GIN-VUE-ADMIN1',
5+
vueClientPort: 8080,
6+
goServerPort: 8888,
57
baseCdnUrl: '//cdn.staticfile.org',
68
cdns: [
79
/**

web/src/main.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,11 @@ export default new Vue({
146146
store
147147
}).$mount('#app')
148148

149-
150149
console.log(`
151150
欢迎使用 Gin-Vue-Admin
152151
当前版本:V2.4.1
153152
加群方式:微信:shouzi_1994 QQ群:622360840
154-
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
155-
默认前端文件运行地址:http://127.0.0.1:8080
153+
默认自动化文档地址:http://127.0.0.1:` + buildConfig.goServerPort + `/swagger/index.html
154+
默认前端文件运行地址:http://127.0.0.1:`+ buildConfig.vueClientPort + `
156155
如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/docs/coffee
157156
`)

web/src/view/systemTools/formCreate/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
<template>
22
<div style="height:80vh">
3-
<iframe width="100%" height="100%" :src="'http://127.0.0.1:8888/form-generator/#/'" frameborder="0"></iframe>
3+
<iframe width="100%" height="100%" :src="url" frameborder="0"></iframe>
44
</div>
55
</template>
66

77
<script>
8+
import buildConf from '@/../build.config.js'
89
var path = process.env.VUE_APP_BASE_API
910
export default {
1011
name:"FormGenerator",
1112
data(){
1213
return{
14+
url:'http://127.0.0.1:' + buildConf.goServerPort + '/form-generator/#/',
1315
basePath:path
1416
}
1517
},

web/vue.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
lintOnSave: process.env.NODE_ENV === 'development',
1616
productionSourceMap: false,
1717
devServer: {
18-
port: 8080,
18+
port: buildConf.vueClientPort,
1919
open: true,
2020
overlay: {
2121
warnings: false,
@@ -25,7 +25,7 @@ module.exports = {
2525
// 把key的路径代理到target位置
2626
// detail: https://cli.vuejs.org/config/#devserver-proxy
2727
[process.env.VUE_APP_BASE_API]: { //需要代理的路径 例如 '/api'
28-
target: `http://127.0.0.1:8888/`, //代理到 目标路径
28+
target: `http://127.0.0.1:` + buildConf.goServerPort + `/`, //代理到 目标路径
2929
changeOrigin: true,
3030
pathRewrite: { // 修改路径数据
3131
['^' + process.env.VUE_APP_BASE_API]: '' // 举例 '^/api:""' 把路径中的/api字符串删除

0 commit comments

Comments
 (0)