const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  lintOnSave: false,
  transpileDependencies: true,
  pluginOptions: {
    vuetify: {
      // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vuetify-loader
    }
  },

  devServer: {
    port: 8848,
    open: true,
    proxy: {
      '/api': {
        target: 'http://127.0.0.1:8000',//要代理的本地api地址，也可以换成线上测试地址
        changeOrigin: true,//允许跨域
        pathRewrite: { "^/api": "/api" }//将/api开头替换为/api
      },
      '/upload': {
        target: 'http://127.0.0.1:8000',//要代理的本地api地址，也可以换成线上测试地址
        changeOrigin: true,//允许跨域
        pathRewrite: { "^/upload": "/upload" }//将/api开头替换为/api
      },
      '/getopentime': {
        target: 'http://127.0.0.1:8000',//要代理的本地api地址，也可以换成线上测试地址
        changeOrigin: true,//允许跨域
        pathRewrite: { "^/getopentime": "/getopentime" }//将/api开头替换为/api
      },
      '/modifyopentime': {
        target: 'http://127.0.0.1:8000',//要代理的本地api地址，也可以换成线上测试地址
        changeOrigin: true,//允许跨域
        pathRewrite: { "^/modifyopentime": "/modifyopentime" }//将/api开头替换为/api
      }
    }
  },
})
