Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bg-ui-demos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
白舜
bg-ui-demos
Commits
1d348cce
Commit
1d348cce
authored
Feb 24, 2023
by
白舜
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vite配置代理到后端测试
parent
ad547d0b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
vite.config.js
vite.config.js
+45
-0
No files found.
vite.config.js
View file @
1d348cce
...
@@ -16,5 +16,50 @@ export default defineConfig({
...
@@ -16,5 +16,50 @@ export default defineConfig({
},
},
server
:
{
server
:
{
port
:
3001
,
port
:
3001
,
proxy
:
{
// 选项写法
"
/apaas/data
"
:
{
target
:
"
https://apaas5.wodcloud.com/apaas/data
"
,
// 所要代理的目标地址
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
data/
,
""
),
// 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin
:
true
,
// true/false, Default: false - changes the origin of the host header to the target URL
secure
:
false
,
// 解决证书缺失问题
},
"
/apaas/system
"
:
{
target
:
"
https://apaas5.wodcloud.com/apaas/system
"
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
system/
,
""
),
changeOrigin
:
true
,
secure
:
false
,
},
"
/apaas/service
"
:
{
target
:
"
https://apaas5.wodcloud.com/apaas/service
"
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
service/
,
""
),
changeOrigin
:
true
,
secure
:
false
,
},
"
/apaas/common
"
:
{
target
:
"
https://apaas5.wodcloud.com/apaas/common
"
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
common/
,
""
),
changeOrigin
:
true
,
secure
:
false
,
},
"
/apaas/manage/ui
"
:
{
target
:
"
https://apaas5.wodcloud.com/apaas/manage/ui
"
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
manage
\/
ui/
,
""
),
changeOrigin
:
true
,
secure
:
false
,
},
"
/apaas/portal/v5
"
:
{
target
:
"
https://apaas5.wodcloud.com/apaas/portal/v5
"
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
portal
\/
v5/
,
""
),
changeOrigin
:
true
,
secure
:
false
,
},
"
/apaas/application/v5
"
:
{
target
:
"
https://apaas5.wodcloud.com/apaas/application/v5
"
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
application
\/
v5/
,
""
),
changeOrigin
:
true
,
secure
:
false
,
},
},
},
},
});
});
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