Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mobi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wbx-PCAndMobi
mobi
Commits
ffe608b8
Commit
ffe608b8
authored
May 07, 2021
by
程卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试更改打包环境与对应的接口api
parent
b03791a6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
68 deletions
+43
-68
webpack.prod.conf.js
build/webpack.prod.conf.js
+2
-4
devOnline.env.js
config/devOnline.env.js
+0
-4
index.js
config/index.js
+1
-1
package.json
package.json
+2
-1
main.js
src/main.js
+8
-1
getMicRouters.js
src/router/getMicRouters.js
+8
-0
api.js
src/server/api.js
+22
-57
No files found.
build/webpack.prod.conf.js
View file @
ffe608b8
...
@@ -15,10 +15,8 @@ console.log(process.env.NODE_ENV)
...
@@ -15,10 +15,8 @@ console.log(process.env.NODE_ENV)
let
env
let
env
if
(
process
.
env
.
NODE_ENV
===
'sit'
)
{
if
(
process
.
env
.
NODE_ENV
===
'sit'
)
{
env
=
require
(
'../config/sit.env'
)
env
=
require
(
'../config/sit.env'
)
}
else
if
(
process
.
env
.
NODE_ENV
===
'uat'
)
{
}
else
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
env
=
require
(
'../config/uat.env'
)
env
=
require
(
'../config/prod.env'
)
}
else
if
(
process
.
env
.
NODE_ENV
===
'devol'
)
{
env
=
require
(
'../config/devOnline.env'
)
}
else
if
(
process
.
env
.
NODE_ENV
===
'pudong-sit'
)
{
}
else
if
(
process
.
env
.
NODE_ENV
===
'pudong-sit'
)
{
env
=
require
(
'../config/pudong/sit.env'
)
env
=
require
(
'../config/pudong/sit.env'
)
}
else
if
(
process
.
env
.
NODE_ENV
===
'pudong-prod'
)
{
}
else
if
(
process
.
env
.
NODE_ENV
===
'pudong-prod'
)
{
...
...
config/devOnline.env.js
deleted
100755 → 0
View file @
b03791a6
'use strict'
module
.
exports
=
{
NODE_ENV
:
'"devol"'
}
config/index.js
View file @
ffe608b8
...
@@ -28,7 +28,7 @@ module.exports = {
...
@@ -28,7 +28,7 @@ module.exports = {
},
},
// Various Dev Server settings
// 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
port
:
8080
,
// can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser
:
false
,
autoOpenBrowser
:
false
,
errorOverlay
:
true
,
errorOverlay
:
true
,
...
...
package.json
View file @
ffe608b8
...
@@ -9,7 +9,8 @@
...
@@ -9,7 +9,8 @@
"start"
:
"npm run dev"
,
"start"
:
"npm run dev"
,
"lint"
:
"eslint --fix --ext .js,.vue src"
,
"lint"
:
"eslint --fix --ext .js,.vue src"
,
"build"
:
"cross-env NODE_ENV='production' node build/build.js"
,
"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-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: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"
,
"build:xuhui-sit"
:
"cross-env NODE_ENV='xuhui-sit' node build/build.js"
,
...
...
src/main.js
View file @
ffe608b8
...
@@ -195,9 +195,16 @@ const render = ({appContent, loading} = {}) => { // 渲染方法
...
@@ -195,9 +195,16 @@ const render = ({appContent, loading} = {}) => { // 渲染方法
let
system
//= micSystemsList
let
system
//= micSystemsList
let
env
=
process
.
env
.
NODE_ENV
let
env
=
process
.
env
.
NODE_ENV
//
console.log(process.env.NODE_ENV, 'NODE_ENV')
console
.
log
(
process
.
env
.
NODE_ENV
,
'NODE_ENV'
)
switch
(
env
)
{
switch
(
env
)
{
// case env.indexOf('pudong') > -1: // 根据当前打包的项目调用该项目对应的路由
// case env.indexOf('pudong') > -1: // 根据当前打包的项目调用该项目对应的路由
case
'sit'
:
system
=
micSystemsList
.
sit
break
case
'production'
:
system
=
micSystemsList
.
prod
break
case
'pudong-sit'
:
case
'pudong-sit'
:
system
=
micSystemsList
.
sit
system
=
micSystemsList
.
sit
break
break
...
...
src/router/getMicRouters.js
View file @
ffe608b8
...
@@ -14,6 +14,14 @@ async function GetRoutes(router) {
...
@@ -14,6 +14,14 @@ async function GetRoutes(router) {
let
MicRouters
let
MicRouters
switch
(
env
)
{
switch
(
env
)
{
// case env.indexOf('pudong') > -1: // 根据当前打包的项目调用该项目对应的路由
// case env.indexOf('pudong') > -1: // 根据当前打包的项目调用该项目对应的路由
case
'sit'
:
MicRouters
=
documents
break
case
'production'
:
MicRouters
=
documents
break
case
'pudong-sit'
:
case
'pudong-sit'
:
MicRouters
=
pudong
MicRouters
=
pudong
break
break
...
...
src/server/api.js
View file @
ffe608b8
...
@@ -5,73 +5,40 @@ let BASE_URL = '', MOCK_URL='',
...
@@ -5,73 +5,40 @@ let BASE_URL = '', MOCK_URL='',
* 1、此处配置当前项目在不同环境下的API请求前缀
* 1、此处配置当前项目在不同环境下的API请求前缀
* 2、前端服务间、后端服务间需做跨域处理
* 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'
:
* 此处为不同项目所使用的不同接口api, 根据当前浏览器访问的地址来变更对应的接口地址
BASE_URL
=
'http://yangpu-hm.omniview.pro/api/v2'
,
* 如果有新增的区局项目 需要将对应的接口地址放入此数组中
FANGDI_URL
=
'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
*/
const
apiList
=
[
break
'http://pudong.hm.omniview.pro/api/v2'
,
//浦东sit
'http://10.220.105.137:81/api'
,
//浦东prod
case
'yangpu-prod'
:
'http://xuhui.hm.omniview.pro/api/v2'
,
//徐汇sit
BASE_URL
=
'http://10.216.118.142/api'
,
'http://31.0.161.39/apiv2'
,
//徐汇prod
FANGDI_URL
=
'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
'http://yangpu-hm.omniview.pro/api/v2'
,
//杨浦sit
'http://10.216.118.142/api'
,
//杨浦prod
break
'http://huangpu.hm.omniview.pro/api/v2'
,
//黄浦sit
'http://172.82.26.1/api'
,
//黄浦prod
case
'huangpu-sit'
:
]
BASE_URL
=
'http://huangpu.hm.omniview.pro/api/v2'
,
FANGDI_URL
=
'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
break
MOCK_URL
=
'https://yapi.omniview.pro/mock/283'
// yapi上的mock地址
case
'huangpu-prod'
:
// 根据当前地址栏访问的地址来决定接口访问的前缀 (生产或测试环境)
BASE_URL
=
'http://172.82.26.1/api'
,
if
(
apiList
.
find
(
item
=>
item
.
indexOf
(
window
.
location
.
origin
)
!=
-
1
))
{
FANGDI_URL
=
'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
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://31.0.161.39/apiv2'
// BASE_URL = 'http://211.136.105.193/apiv2'
// BASE_URL = 'http://211.136.105.193/apiv2'
// BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
// BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
BASE_URL
=
'http://xuhui.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://pudong.hm.omniview.pro/api/v2'
// BASE_URL = 'http://211.136.105.193/apiv2'
// 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 {
...
@@ -205,8 +172,6 @@ export default {
get_specialInspection
:
'/service-documents-ddd/statistical/specialInspection'
,
//行业督查数字
get_specialInspection
:
'/service-documents-ddd/statistical/specialInspection'
,
//行业督查数字
get_month_check
:
'service-documents-ddd/dashboard/house/month'
,
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'
,
//首页-房办月查-物业双周查-经理自查
GET_FB_WY_MANAGE_CHECK
:
'/service-documents-ddd/checkOrder/dahboard/countDatas'
,
//首页-房办月查-物业双周查-经理自查
//角色管理
//角色管理
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment