Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
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
ReactWeb5
wisdom-components
Commits
4b3fa918
Commit
4b3fa918
authored
Dec 09, 2022
by
崔佳豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 代理配置分离
parent
8484b5bd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
9 deletions
+34
-9
.gitignore
.gitignore
+4
-0
config.js
config/config.js
+11
-9
proxy.js
config/proxy.js
+19
-0
No files found.
.gitignore
View file @
4b3fa918
...
@@ -42,3 +42,6 @@ screenshot
...
@@ -42,3 +42,6 @@ screenshot
# devServer-host
# devServer-host
host/
host/
webpack.host.js
webpack.host.js
.env
.env.local
\ No newline at end of file
.umirc
.js
→
config/config
.js
View file @
4b3fa918
import
chalk
from
'chalk'
;
import
chalk
from
'chalk'
;
import
{
readdirSync
}
from
'fs'
;
import
{
readdirSync
}
from
'fs'
;
import
{
join
}
from
'path'
;
import
{
join
}
from
'path'
;
import
proxy
from
'./proxy'
;
const
headPkgList
=
[];
const
headPkgList
=
[];
const
pkgList
=
[
'base-components'
,
'extend-components'
]
const
pkgList
=
[
'base-components'
,
'extend-components'
]
.
map
((
dir
)
=>
{
.
map
((
dir
)
=>
{
const
list
=
readdirSync
(
join
(
__dirname
,
'packages'
,
dir
)).
map
((
item
)
=>
item
+
`!
${
dir
}
`
);
const
list
=
readdirSync
(
join
(
__dirname
,
'
../
packages'
,
dir
)).
map
((
item
)
=>
item
+
`!
${
dir
}
`
);
return
list
.
filter
((
pkg
)
=>
pkg
.
charAt
(
0
)
!==
'.'
&&
!
headPkgList
.
includes
(
pkg
));
return
list
.
filter
((
pkg
)
=>
pkg
.
charAt
(
0
)
!==
'.'
&&
!
headPkgList
.
includes
(
pkg
));
})
})
.
flat
();
.
flat
();
const
alias
=
pkgList
.
reduce
((
pre
,
pkg
)
=>
{
const
alias
=
pkgList
.
reduce
((
pre
,
pkg
)
=>
{
const
path
=
pkg
.
split
(
'!'
);
const
path
=
pkg
.
split
(
'!'
);
pre
[
`@wisdom-components/pro-
${
path
[
0
]}
`
]
=
join
(
__dirname
,
'packages'
,
path
[
1
],
path
[
0
],
'src'
);
pre
[
`@wisdom-components/pro-
${
path
[
0
]}
`
]
=
join
(
__dirname
,
'../packages'
,
path
[
1
],
path
[
0
],
'src'
,
);
return
{
return
{
...
pre
,
...
pre
,
};
};
...
@@ -116,17 +123,12 @@ export default {
...
@@ -116,17 +123,12 @@ export default {
'EC_HistoryInfo'
,
'EC_HistoryInfo'
,
'EC_RealTimeInfo'
,
'EC_RealTimeInfo'
,
'EC_ConfigurationView'
,
'EC_ConfigurationView'
,
'EC_HistoryView'
,
],
],
},
},
],
],
},
},
proxy
:
{
proxy
,
'/api'
:
{
target
:
'http://192.168.10.150:8669'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/api'
:
''
},
},
},
define
:
{
define
:
{
DUMI_TYPE
:
'dumi'
,
DUMI_TYPE
:
'dumi'
,
},
},
...
...
config/proxy.js
0 → 100644
View file @
4b3fa918
const
proxyURL
=
process
.
env
.
PANDA_ENV_PROXY
||
'http://192.168.10.150:8669'
;
export
default
{
'/api'
:
{
target
:
'http://192.168.10.150:8669'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/api'
:
''
},
},
'/PandaMonitor'
:
{
target
:
proxyURL
,
changeOrigin
:
true
,
headers
:
{
'Access-Control-Allow-Origin'
:
'*'
,
},
pathRewrite
:
{
'/PandaMonitor'
:
'/PandaMonitor'
,
},
},
};
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