vue.config.js 690 B

123456789101112131415161718
  1. const { defineConfig } = require('@vue/cli-service')
  2. module.exports = defineConfig({
  3. transpileDependencies: true,
  4. devServer: {
  5. host: 'localhost', // 本地地址
  6. port: 8081, // 端口号
  7. open: true, // 配置项目在启动时自动在浏览器打开
  8. proxy: {
  9. '/appointment' : { // '/api'是代理标识,一般是每个接口前的相同部分
  10. target: "http://114.135.61.186:8339", // 请求地址,一般是服务器地址
  11. changeOrigin: true, // 是否进行跨域
  12. pathRewrite: { // pathRewrite的作用是把请求接口中的 '/api'替换掉,一般是替换为空""
  13. }
  14. }
  15. }
  16. }
  17. })