mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-12-09 14:40:27 +08:00
添加vite.config.ts简化axios,添加请求跟路径和超时时长
This commit is contained in:
26
vite.config.ts
Normal file
26
vite.config.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
module.exports = {
|
||||
alias: {},
|
||||
// 是否自动在浏览器打开
|
||||
open: false,
|
||||
// 是否开启 https
|
||||
https: false,
|
||||
// 服务端渲染
|
||||
ssr: false,
|
||||
/**
|
||||
* Base public path when served in production.
|
||||
* @default '/'
|
||||
*/
|
||||
/**
|
||||
* Directory relative from `root` where build output will be placed. If the
|
||||
* directory exists, it will be removed before the build.
|
||||
* @default 'dist'
|
||||
*/
|
||||
// 反向代理
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:3000',
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/^\/api/, '')
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user