Commit 0c75a9a 1 parent 1aeefb8 commit 0c75a9a Copy full SHA for 0c75a9a
File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,12 @@ const Article = (data) => {
29
29
]
30
30
const { title, description, keywords} = seo || { } ;
31
31
const sortTag = tagList ?. find ( item => item . key === tag_type ) ?. label ;
32
+ const env = process . env . NODE_ENV || 'development' ;
33
+ const fetchUrl = env === 'development' ? 'http://localhost:3002' : '' ;
32
34
33
35
useEffect ( ( ) => {
34
36
setMobile ( isMobile ( window ) ) ;
35
- fetch ( ' /api/getTagList' )
37
+ fetch ( ` ${ fetchUrl } /api/getTagList` )
36
38
. then ( res => res . json ( ) )
37
39
. then ( res => {
38
40
const tagList = res . data ?. map ( ( item ) => {
@@ -75,7 +77,7 @@ const Article = (data) => {
75
77
sort_type,
76
78
}
77
79
setSpinning ( true )
78
- fetch ( `/api/getArticleList?${ new URLSearchParams ( params ) . toString ( ) } ` )
80
+ fetch ( `${ fetchUrl } /api/getArticleList?${ new URLSearchParams ( params ) . toString ( ) } ` )
79
81
. then ( res => res . json ( ) )
80
82
. then ( res => {
81
83
handleArticleList ( res . data )
You can’t perform that action at this time.
0 commit comments