Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-pda-scan
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
0
Merge Requests
0
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
ximai
mes-pda-scan
Commits
2dc88d48
Commit
2dc88d48
authored
May 18, 2026
by
chicheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
域名配置减少到一处
parent
27bd98f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
config.js
common/config.js
+5
-5
host.js
common/host.js
+11
-0
vue.config.js
vue.config.js
+2
-1
No files found.
common/config.js
View file @
2dc88d48
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
;
common/host.js
0 → 100644
View file @
2dc88d48
/**
* 后台接口服务地址(仅在此处维护)
* 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
View file @
2dc88d48
//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'
:
''
...
...
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