Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
wmsMin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
33fce56e
authored
Apr 17, 2026
by
liangjianmin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
重构 API 环境配置,支持动态切换生产和开发环境
parent
4aa895c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
util/api.js
util/api.js
View file @
33fce56e
const
API_BASE
=
'https://api.ichunt.com'
;
// 环境配置:'production' 正式环境 | 'development' 测试环境
const
API_BASE_OSS
=
'https://image.ichunt.net'
;
//oss系统
var
ENV
=
'development'
;
const
API_BASE_OSS_HK
=
'http://hk.image.semour.com'
;
//oss系统 HK
const
API_BASE_WMS
=
'https://wms.ichunt.net'
;
//WMS系统
// const API_BASE = 'http://api.liexin.com';
// 环境配置映射
// const API_BASE_OSS = 'http://image.liexindev.net';
var
ENV_CONFIG
=
{
// const API_BASE_OSS_HK = 'http://image.liexindev.net'; //oss系统 HK
production
:
{
// const API_BASE_WMS = 'http://wms.liexindev.net'; //WMS系统
API_BASE
:
'https://api.ichunt.com'
,
API_BASE_OSS
:
'https://image.ichunt.net'
,
API_BASE_OSS_HK
:
'http://hk.image.semour.com'
,
API_BASE_WMS
:
'https://wms.ichunt.net'
},
development
:
{
API_BASE
:
'http://api.liexin.com'
,
API_BASE_OSS
:
'http://image.liexindev.net'
,
API_BASE_OSS_HK
:
'http://image.liexindev.net'
,
API_BASE_WMS
:
'http://wms.liexindev.net'
}
};
// 当前环境配置
var
currentEnv
=
ENV_CONFIG
[
ENV
];
var
API_BASE
=
currentEnv
.
API_BASE
;
var
API_BASE_OSS
=
currentEnv
.
API_BASE_OSS
;
var
API_BASE_OSS_HK
=
currentEnv
.
API_BASE_OSS_HK
;
var
API_BASE_WMS
=
currentEnv
.
API_BASE_WMS
;
const
API
=
{
// 环境日志输出
var
envText
=
ENV
===
'production'
?
'🔴 正式环境'
:
'🟢 测试环境'
;
console
.
log
(
`[环境]
${
envText
}
`
);
var
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