vue-cli跨域
一、vue.config.js 增加跨域代码
// 跨域处理
module.exports = {
devServer: {
port: 8088,
host: "localhost",
open: true,
// 跨域需要保持为空
proxy: {
"/api": {
target: "http://demoapi.com/api",
changeOrigin: true,
pathRewrite:
原创
2022-03-19 17:21:46 ·
1018 阅读 ·
1 评论