Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
aba762c5
Commit
aba762c5
authored
Jan 18, 2022
by
beisir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加pre配置
parent
94d07dd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
env.config.js
config/env.config.js
+23
-5
package.json
package.json
+1
-0
No files found.
config/env.config.js
View file @
aba762c5
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
le
t
envAPi
=
{
cons
t
envAPi
=
{
api
:
'
//backstms-test1.liangkebang.net
'
,
kdspOpApi
:
'
https://kdsp-operation-test1.liangkebang.net
'
,
kdspApi
:
'
https://sc-op-api-test1.liangkebang.net
'
,
...
...
@@ -11,7 +12,7 @@ let envAPi = {
opapiHost
:
'
https://opapi-test1.liangkebang.net
'
,
};
le
t
prodApi
=
{
cons
t
prodApi
=
{
api
:
'
//backstms.q-gp.com
'
,
kdspOpApi
:
'
//kdsp-operation.q-gp.com
'
,
prologueDomain
:
'
//prologue.q-gp.com
'
,
...
...
@@ -22,7 +23,24 @@ let prodApi = {
opapiHost
:
'
https://opapi.xyqb.com
'
,
};
let
exportApi
;
isProduction
?
(
exportApi
=
prodApi
)
:
(
exportApi
=
envAPi
);
const
preProdApi
=
{
api
:
'
//backstms-pre.xyqb.com
'
,
kdspOpApi
:
'
//kdsp-operation-pre.q-gp.com
'
,
prologueDomain
:
'
//prologue.q-gp.com
'
,
kdspApi
:
'
//sc-op-api-pre.q-gp.com
'
,
goodsApi
:
'
https://sc-merchant-api.q-gp.com
'
,
// 线上环境打包域名
qiniuHost
:
'
https://appsync.lkbang.net
'
,
opapiHost
:
'
https://opapi-pre.q-gp.com
'
,
};
const
exportApi
=
envAPi
;
if
(
isPre
)
{
exportApi
=
preProdApi
;
}
else
if
(
isProduction
)
{
exportApi
=
prodApi
;
}
module
.
exports
=
exportApi
;
// let exportApi;
// isProduction ? (exportApi = prodApi) : (exportApi = envAPi);
export
default
exportApi
;
//
export default exportApi;
package.json
View file @
aba762c5
...
...
@@ -6,6 +6,7 @@
"scripts"
:
{
"analyze"
:
"cross-env ANALYZE=1 umi build"
,
"build"
:
"umi build"
,
"build:pre"
:
"cross-env PRE_ENV=pre umi build"
,
"deploy"
:
"npm run site && npm run gh-pages"
,
"fetch:blocks"
:
"pro fetch-blocks && npm run prettier"
,
"format-imports"
:
"cross-env import-sort --write '**/*.{js,jsx,ts,tsx}'"
,
...
...
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