本文共 884 字,大约阅读时间需要 2 分钟。
devServer: { host: 'localhost', port: 8080, // 端口 https: false, proxy: { // 配置跨域 '/api': { target: '目标域名 如 http://baidu.com', // 代理的接口域名以及端口号; ws: true, // 支持ws协议;websocket的缩写; changeOrigin: true,// 是否跨域 pathRewrite: { // 路径替换 '^/api': '' } } }, hotOnly: false, before: app => { } },
this.$axios({ url: "index", method: "get", params: {}, }).then((res) => { console.log(res); });
转载地址:http://okzmf.baihongyu.com/