Browse Source

Update vite.config.js

main
奇淼(piexlmax 3 years ago
committed by GitHub
parent
commit
c151619797
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      web/vite.config.js

3
web/vite.config.js

@ -50,8 +50,7 @@ export default ({
// 把key的路径代理到target位置 // 把key的路径代理到target位置
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VITE_BASE_API]: { // 需要代理的路径 例如 '/api' [process.env.VITE_BASE_API]: { // 需要代理的路径 例如 '/api'
// target: `${process.env.VITE_BASE_PATH}:${process.env.VITE_SERVER_PORT}/`, // 代理到 目标路径
target: `https://demo.gin-vue-admin.com/api/`, // 代理到 目标路径
target: `${process.env.VITE_BASE_PATH}:${process.env.VITE_SERVER_PORT}/`, // 代理到 目标路径
changeOrigin: true, changeOrigin: true,
rewrite: path => path.replace(new RegExp('^' + process.env.VITE_BASE_API), ''), rewrite: path => path.replace(new RegExp('^' + process.env.VITE_BASE_API), ''),
} }

Loading…
Cancel
Save