Browse Source

【派格1.5】ip配置文件提出外部配置

HQ
安虹睿 7 months ago
parent
commit
024f8ef66b
  1. 11
      vue/public/config.js
  2. 5
      vue/public/index.html
  3. 6
      vue/src/App.vue
  4. 26
      vue/static/config.js

11
vue/public/config.js

@ -0,0 +1,11 @@
// 开发
window.SITE_CONFIG['config_ip'] = 'http://192.168.0.228'
window.SITE_CONFIG['config_auth_port'] = '7696'
window.SITE_CONFIG['config_public_port'] = '7692'
window.SITE_CONFIG['config_backend_port'] = '7692'
// 发布
// window.SITE_CONFIG['config_ip'] = 'http://192.168.0.68'
// window.SITE_CONFIG['config_auth_port'] = '8066'
// window.SITE_CONFIG['config_public_port'] = '8092'
// window.SITE_CONFIG['config_backend_port'] = '8092'

5
vue/public/index.html

@ -6,7 +6,12 @@
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<script>
// 初始化
window.SITE_CONFIG = {};
</script>
<title><%= webpackConfig.name %></title>
<script src="./config.js"></script>
<!-- <link rel="stylesheet" href="./css/style.css" type="text/css" />-->
<!-- <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> -->

6
vue/src/App.vue

@ -6,7 +6,6 @@
<script>
import {mapGetters} from 'vuex'
export default {
name: 'App',
computed: {
@ -42,5 +41,10 @@
},
}
localStorage.setItem('config_ip',window.SITE_CONFIG['config_ip'])
localStorage.setItem('config_auth_port',window.SITE_CONFIG['config_auth_port'])
localStorage.setItem('config_public_port',window.SITE_CONFIG['config_public_port'])
localStorage.setItem('config_backend_port',window.SITE_CONFIG['config_backend_port'])
</script>

26
vue/static/config.js

@ -11,10 +11,15 @@ if (process.env.NODE_ENV === "development") {
// public_port: "7692",
// backend_port: "7692",
ip: "http://192.168.0.228",
auth_port: "7696",
public_port: "7692",
backend_port: "7692",
// ip: "http://192.168.0.228",
// auth_port: "7696",
// public_port: "7692",
// backend_port: "7692",
ip: localStorage.getItem('config_ip'),
auth_port: localStorage.getItem('config_auth_port'),
public_port: localStorage.getItem('config_public_port'),
backend_port: localStorage.getItem('config_backend_port'),
},
basic: {},
upload: {
@ -57,10 +62,15 @@ if (process.env.NODE_ENV === "development") {
// public_port: "7692",
// backend_port: "7692",
ip: "http://192.168.0.68",
auth_port: "8066",
public_port: "8092",
backend_port: "8092",
// ip: "http://192.168.0.68",
// auth_port: "8066",
// public_port: "8092",
// backend_port: "8092",
ip: localStorage.getItem('config_ip'),
auth_port: localStorage.getItem('config_auth_port'),
public_port: localStorage.getItem('config_public_port'),
backend_port: localStorage.getItem('config_backend_port'),
},
basic: {},
upload: {

Loading…
Cancel
Save