Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-website-ssr-template
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liguokang
xiaomai-website-ssr-template
Commits
0f7df779
Commit
0f7df779
authored
Aug 03, 2021
by
Jamos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
🎨
parent
32588175
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
16 deletions
+19
-16
common/api/interfaces.js
+3
-2
common/utils/request.js
+2
-1
common/webConfigs.js
+8
-7
package.json
+2
-2
siteMapScript.js
+4
-4
No files found.
common/api/interfaces.js
View file @
0f7df779
...
...
@@ -2,11 +2,12 @@
* @Author: liguokang
* @Date: 2021-07-15 10:43:34
* @LastEditors: liguokang
* @LastEditTime: 2021-08-03 20:3
0:02
* @LastEditTime: 2021-08-03 20:3
7:14
* @Description:
* @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有
*/
const
{
webDomain
,
apiDomain
}
=
require
(
'../webConfigs'
);
const
DOMAIN
=
require
(
'../webConfigs'
);
const
{
webDomain
,
apiDomain
}
=
{
...
DOMAIN
.
DOMAIN
};
export
const
Interfaces
=
{
OnlineUrl
:
'https://'
,
...
...
common/utils/request.js
View file @
0f7df779
import
axios
from
'axios'
;
import
{
load
as
cookieLoad
,
save
as
cookieSave
}
from
'react-cookies'
;
const
{
webDomain
,
apiDomain
}
=
require
(
'./common/webConfigs'
);
const
DOMAIN
=
require
(
'../webConfigs'
);
const
{
webDomain
,
apiDomain
}
=
{
...
DOMAIN
.
DOMAIN
};
// 创建axios实例
let
serverPath
=
apiDomain
;
...
...
common/webConfigs.js
View file @
0f7df779
...
...
@@ -2,26 +2,27 @@
* @Author: liguokang
* @Date: 2021-07-29 16:19:43
* @LastEditors: liguokang
* @LastEditTime: 2021-0
8-03 20:29:54
* @LastEditTime: 2021-0
7-29 16:46:20
* @Description:
* @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有
*/
le
t
DEPLOY_ENV
=
process
.
env
.
DEPLOY_ENV
;
cons
t
DEPLOY_ENV
=
process
.
env
.
DEPLOY_ENV
;
const
webDomain
s
=
{
const
webDomain
=
{
dev
:
'https://dev.xiaomai5.com/'
,
rc
:
'https://rc.xiaomai5.com/'
,
gray
:
'https://rc.xiaomai5.com/'
,
prod
:
'https://www.xiaomai5.com/'
,
};
const
apiDomain
s
=
{
const
apiDomain
=
{
dev
:
'https://dev-heimdall.xiaomai5.com/'
,
rc
:
'https://rc-heimdall.xiaomai5.com/'
,
gray
:
'https://gray-heimdall.xiaomai5.com/'
,
prod
:
'https://heimdall.xiaomai5.com/'
,
};
let
webDomain
=
webDomains
[
DEPLOY_ENV
];
let
apiDomain
=
apiDomains
[
DEPLOY_ENV
];
export
{
webDomain
,
apiDomain
};
exports
.
DOMAIN
=
{
webDomain
:
webDomain
[
DEPLOY_ENV
],
apiDomain
:
apiDomain
[
DEPLOY_ENV
],
};
package.json
View file @
0f7df779
...
...
@@ -3,14 +3,14 @@
"version"
:
"1.1.0"
,
"scripts"
:
{
"dev"
:
"next dev"
,
"build"
:
"next build && next export -o dist && npm run
nd
"
,
"build"
:
"next build && next export -o dist && npm run
siteMap
"
,
"export"
:
"npm run build && next export"
,
"start"
:
"next start"
,
"build:dev"
:
"cross-env DEPLOY_ENV=dev npm run build"
,
"build:rc"
:
"cross-env DEPLOY_ENV=rc npm run build"
,
"build:gray"
:
"cross-env DEPLOY_ENV=gray npm run build"
,
"build:prod"
:
"cross-env DEPLOY_ENV=prod npm run build"
,
"
nd"
:
"node s
cript.js"
,
"
siteMap"
:
"node siteMapS
cript.js"
,
"prepare"
:
"husky install"
,
"precommit"
:
"pretty-quick --staged"
},
...
...
script.js
→
s
iteMapS
cript.js
View file @
0f7df779
...
...
@@ -2,18 +2,18 @@
* @Author: liguokang
* @Date: 2021-07-29 16:14:30
* @LastEditors: liguokang
* @LastEditTime: 2021-08-03 20:
30:47
* @LastEditTime: 2021-08-03 20:
19:05
* @Description:
* @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有
*/
const
fs
=
require
(
'fs'
);
const
{
webDomain
,
apiDomain
}
=
require
(
'./common/webConfigs'
);
const
DOMAIN
=
require
(
'./common/webConfigs'
);
const
{
webDomain
,
apiDomain
}
=
{
...
DOMAIN
.
DOMAIN
};
const
readStream
=
fs
.
createReadStream
(
'./sitemap/sitemap.html'
,
{
encoding
:
'utf8'
});
const
writeStream
=
fs
.
createWriteStream
(
'./dist/sitemap.html'
,
{
encoding
:
'utf8'
});
console
.
log
(
webDomain
,
apiDomain
,
'222222222222222222222222222222222222222222222222222222222222'
);
readStream
.
on
(
'data'
,
(
data
)
=>
{
let
reData
=
data
.
replace
(
/https
\:\/\/
www
\.
xiaomai5
\.
com
\/
/g
,
webDomain
);
reData
=
reData
.
replace
(
/https
\:\/\/
heimdall
\.
xiaomai5
\.
com
\/
/g
,
apiDomain
);
...
...
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