Commit ffe608b8 authored by 程卓's avatar 程卓

测试更改打包环境与对应的接口api

parent b03791a6
......@@ -15,10 +15,8 @@ console.log(process.env.NODE_ENV)
let env
if (process.env.NODE_ENV === 'sit') {
env = require('../config/sit.env')
} else if (process.env.NODE_ENV === 'uat') {
env = require('../config/uat.env')
} else if (process.env.NODE_ENV === 'devol') {
env = require('../config/devOnline.env')
} else if (process.env.NODE_ENV === 'production') {
env = require('../config/prod.env')
} else if (process.env.NODE_ENV === 'pudong-sit') {
env = require('../config/pudong/sit.env')
} else if (process.env.NODE_ENV === 'pudong-prod') {
......
'use strict'
module.exports = {
NODE_ENV: '"devol"'
}
......@@ -28,7 +28,7 @@ module.exports = {
},
// Various Dev Server settings
host: '0.0.0.0', // can be overwritten by process.env.HOST
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
......
......@@ -9,7 +9,8 @@
"start": "npm run dev",
"lint": "eslint --fix --ext .js,.vue src",
"build": "cross-env NODE_ENV='production' node build/build.js",
"build:devol": "cross-env NODE_ENV='devol' node build/build.js",
"build:sit": "cross-env NODE_ENV='sit' node build/build.js",
"build:prod": "cross-env NODE_ENV='production' node build/build.js",
"build:pudong-sit": "cross-env NODE_ENV='pudong-sit' node build/build.js",
"build:pudong-prod": "cross-env NODE_ENV='pudong-prod' node build/build.js",
"build:xuhui-sit": "cross-env NODE_ENV='xuhui-sit' node build/build.js",
......
......@@ -195,9 +195,16 @@ const render = ({appContent, loading} = {}) => { // 渲染方法
let system //= micSystemsList
let env = process.env.NODE_ENV
// console.log(process.env.NODE_ENV, 'NODE_ENV')
console.log(process.env.NODE_ENV, 'NODE_ENV')
switch (env) {
// case env.indexOf('pudong') > -1: // 根据当前打包的项目调用该项目对应的路由
case 'sit':
system = micSystemsList.sit
break
case 'production':
system = micSystemsList.prod
break
case 'pudong-sit':
system = micSystemsList.sit
break
......
......@@ -14,6 +14,14 @@ async function GetRoutes(router) {
let MicRouters
switch (env) {
// case env.indexOf('pudong') > -1: // 根据当前打包的项目调用该项目对应的路由
case 'sit':
MicRouters = documents
break
case 'production':
MicRouters = documents
break
case 'pudong-sit':
MicRouters = pudong
break
......
......@@ -5,73 +5,40 @@ let BASE_URL = '', MOCK_URL='',
* 1、此处配置当前项目在不同环境下的API请求前缀
* 2、前端服务间、后端服务间需做跨域处理
*/
// console.log(window.location)
console.log(window.location)
switch (process.env.NODE_ENV) {
case 'devol': // 本地线上部署环境下
BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
break
case 'pudong-sit':
BASE_URL = 'http://pudong.hm.omniview.pro/api/v2',
FANGDI_URL = 'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
break
case 'pudong-prod':
// BASE_URL = 'http://211.136.105.193/apiv2',
BASE_URL = 'http://10.220.105.137:81/api'
FANGDI_URL = 'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
break
case 'xuhui-sit':
BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2',
FANGDI_URL = 'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
break
case 'xuhui-prod':
BASE_URL = 'http://31.0.161.39/apiv2',
FANGDI_URL = 'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
break
case 'yangpu-sit':
BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2',
FANGDI_URL = 'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
break
case 'yangpu-prod':
BASE_URL = 'http://10.216.118.142/api',
FANGDI_URL = 'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
break
case 'huangpu-sit':
BASE_URL = 'http://huangpu.hm.omniview.pro/api/v2',
FANGDI_URL = 'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
/**
*
* 此处为不同项目所使用的不同接口api, 根据当前浏览器访问的地址来变更对应的接口地址
* 如果有新增的区局项目 需要将对应的接口地址放入此数组中
*/
const apiList = [
'http://pudong.hm.omniview.pro/api/v2', //浦东sit
'http://10.220.105.137:81/api', //浦东prod
'http://xuhui.hm.omniview.pro/api/v2', //徐汇sit
'http://31.0.161.39/apiv2', //徐汇prod
'http://yangpu-hm.omniview.pro/api/v2', //杨浦sit
'http://10.216.118.142/api', //杨浦prod
'http://huangpu.hm.omniview.pro/api/v2', //黄浦sit
'http://172.82.26.1/api', //黄浦prod
]
break
MOCK_URL = 'https://yapi.omniview.pro/mock/283' // yapi上的mock地址
case 'huangpu-prod':
BASE_URL = 'http://172.82.26.1/api',
FANGDI_URL = 'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
// 根据当前地址栏访问的地址来决定接口访问的前缀 (生产或测试环境)
if (apiList.find(item => item.indexOf(window.location.origin) != -1 )) {
BASE_URL = apiList.find(item => item.indexOf(window.location.origin) != -1 )
break
}else{ // 本地开发环境需要自行调整对应的接口地址
default: // 默认环境下(开发环境)
// BASE_URL = 'http://31.0.161.39/apiv2'
// BASE_URL = 'http://211.136.105.193/apiv2'
// BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
// BASE_URL = 'http://pudong.hm.omniview.pro/api/v2'
// BASE_URL = 'http://211.136.105.193/apiv2'
MOCK_URL = 'https://yapi.omniview.pro/mock/283'
break
}
console.log(BASE_URL)
/**
* 此处配置本项目涉及到的所有
* 要求
......@@ -205,8 +172,6 @@ export default {
get_specialInspection: '/service-documents-ddd/statistical/specialInspection', //行业督查数字
get_month_check: 'service-documents-ddd/dashboard/house/month',
GET_LABEL_LIST: MOCK_URL + '/service-customkey-ddd/labels', // 获取标签列表
GET_FB_WY_MANAGE_CHECK: '/service-documents-ddd/checkOrder/dahboard/countDatas', //首页-房办月查-物业双周查-经理自查
//角色管理
......
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