Vuecli4跨域问题
新建vue.config.js,
// vue.config.js module.export = { dev: { proxyTable: { '/api': { target: 'http://localhost:80', //后端接口地址 changeOrigin: true, //是否允许跨越 pathRewrite: { '^/api': '', //重写, } } } } }

目标url由
http://localhost:80/arcgis/API/4.15/init.js
改为
/api/arcgis/API/4.15/init.js
即可
本文来自博客园,作者:季夏啸华,转载请注明原文链接:https://www.cnblogs.com/jiang2020/p/13502483.html
浙公网安备 33010602011771号