减少冗余代码
This commit is contained in:
@@ -19,9 +19,10 @@ export default defineConfig({
|
||||
server: {
|
||||
port: 8080, // 前端启动的端口
|
||||
proxy: {
|
||||
'/api': { // 所有以api开头的请求都会被代理
|
||||
'/api': {
|
||||
target: 'http://localhost',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user