- 博客(2)
- 收藏
- 关注
原创 egg接口跨域配置
安装egg-cors 安装命令 npm/cnpm install egg-cors --save yarn add egg-cors --save 添加相关配置 在egg项目中 config/plugins.js 添加以下配置 module.exports = { cors: { enable: true, package: 'egg-cors' } } 在egg项目中 config/config.default.js 添加以下配置 module.exports = {
2020-07-02 17:31:16
476
原创 VUE解决跨域问题
在vue项目根目录下创建 vue.config.js 文件 写入如下代码 module.exports = { devServer: { proxy: '代理服务器地址' } } // 或者 module.exports = { devServer: { proxy: { '/api': { target: '代理服务器地址', ws: true // webscoket changeOrigin: true } } } } 在要发送前端请求的页
2020-07-02 17:18:23
433
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人