vite.config.ts中設置
server: {
proxy: {
'/apis': {
target: 'http://localhost:44311/', // 實際請求地址
changeOrigin: true,
rewrite: (path) => path.replace(/^\/apis/, '')
},
},
//默認打開端口
port:5174,
//默認打開瀏覽器
open:true,
},