Commit 2dc88d48 authored by chicheng's avatar chicheng

域名配置减少到一处

parent 27bd98f3
const API_HOST = require('./host.js')
const config = { const config = {
// 产品名称 // 产品名称
...@@ -20,10 +22,8 @@ const config = { ...@@ -20,10 +22,8 @@ const config = {
} }
// 设置后台接口服务的基础地址 // 设置后台接口服务的基础地址(域名见 common/host.js)
config.baseUrl = 'http://localhost:20091'; // H5 本地开发若走代理,可改为:process.env.NODE_ENV === 'development' ? '/api' : API_HOST
// config.baseUrl = process.env.NODE_ENV === 'development' ? '/api' : 'http://182.140.132.45:9094'; // 上海环境 config.baseUrl = API_HOST
// config.baseUrl = process.env.NODE_ENV === 'development' ? '/api' : 'http://192.168.1.128:20091'; // 外网环境
// config.baseUrl = "http://101.200.162.168:8080";
export default config; export default config;
/**
* 后台接口服务地址(仅在此处维护)
* H5 开发代理见 vue.config.js,运行时使用 common/config.js 中的 baseUrl
*/
const API_HOST = 'http://192.168.1.130:20091'
// const API_HOST = 'http://182.140.132.45:9094' // 上海环境
// const API_HOST = 'http://192.168.1.128:20091' // 外网环境
// const API_HOST = 'http://101.200.162.168:8080'
module.exports = API_HOST
//vue.config.js //vue.config.js
const TransformPages = require('uni-read-pages') const TransformPages = require('uni-read-pages')
const API_HOST = require('./common/host.js')
const {webpack} = new TransformPages() const {webpack} = new TransformPages()
module.exports = { module.exports = {
configureWebpack: { configureWebpack: {
...@@ -17,7 +18,7 @@ module.exports = { ...@@ -17,7 +18,7 @@ module.exports = {
devServer: { devServer: {
proxy: { proxy: {
'/api': { '/api': {
target: 'http://localhost:20091', target: API_HOST,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/api': '' '^/api': ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment