online_exam_frontend/vue.config.js

22 lines
907 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
publicPath: '/static',
lintOnSave: false,
devServer: {
host: '0.0.0.0', //可以忽略不写
port: 8084,//它是用来修改你打开后的端口号的
open: true,//值为 true的话项目启动时自动打开到浏览器里边 false不会打开
proxy: {
'/api': {
target: 'http://123.207.17.178:8000',//跨域请求的公共地址
ws: false, //也可以忽略不写,不写不会影响跨域
changeOrigin: true, //是否开启跨域,值为 true 就是开启, false 不开启
// pathRewrite: {
// '^/api': ''//注册全局路径, 但是在你请求的时候前面需要加上 /api
// }
}
}
},
})