vue跨域post

太上老君
• 阅读 1034
proxy: {
  '/api': {
    target: 'xxxxxxxxxxxxxxxx',
    ws: true,
    changeOrigin: true,
    pathRewrite: {
      '^/api': '/api'
    },
    cssSourceMap: false,
    onProxyReq: function (proxyReq, req, res) {
      if (proxyReq.getHeader('origin')) {
        proxyReq.setHeader('origin', 'xxxxxxxxxxxxxxxx')
      }

      console.log('原路径:' + req.originalUrl, '代理路径:' + req.path)
    }
  }

},
点赞
收藏
评论区
推荐文章
Easter79 Easter79
3年前
Vue axios调用第三方接口跨域解决
1.在config目录下index.js文件中设置proxyTable:proxyTable:{'/v1':{target:'https://api.douban.com',changeOrigin:true,pathRewrit
Wesley13 Wesley13
3年前
RBAC 权限模型
RBAC0模型最基本的!(https://oscimg.oschina.net/oscnet/80a47f70d0c945ab47cadc28f63f77ab39d.png)MySQL脚本,没有建立外键约束。!(https://oscimg.oschina.net/oscnet/407d0ad45bb6f39
Stella981 Stella981
3年前
SpringBoot学习:整合shiro自动登录功能(rememberMe记住我功能)
首先在shiro配置类中注入rememberMe管理器!复制代码(https://oscimg.oschina.net/oscnet/675f5689159acfa2c39c91f4df40a00ce0f.gif)/cookie对象;rememberMeCookie()方法是设置Cookie的生成模
Stella981 Stella981
3年前
Leetcode No.39 组合总和
此文转载自:https://blog.csdn.net/jxq0816/article/details/113079141commentBox一、题目描述给定一个无重复元素的数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。candidates 中的数字
Stella981 Stella981
3年前
CAS 实现站内单点登录及实现第三方 OAuth、OpenId 登录(二)
一、登录表单<form:form id"loginForm" method"post" commandName"${commandName}" htmlEscape"true"    <form:errors path"" element"em" cssClass"" /    <c:if t
Stella981 Stella981
3年前
Docker图形化工具——Portainer
目标搭建dockerui!(https://oscimg.oschina.net/oscnet/53bc95a39fb664ce92be04ec7cda07e19a0.jpg)
Easter79 Easter79
3年前
SpringBoot学习:整合shiro自动登录功能(rememberMe记住我功能)
首先在shiro配置类中注入rememberMe管理器!复制代码(https://oscimg.oschina.net/oscnet/675f5689159acfa2c39c91f4df40a00ce0f.gif)/cookie对象;rememberMeCookie()方法是设置Cookie的生成模
Stella981 Stella981
3年前
LeetCode 39. Combination Sum
问题链接LeetCode39.CombinationSum(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fleetcode.com%2Fproblems%2Fcombinationsum%2Fdescription%2F)题目解析给一组数和一个目
Stella981 Stella981
3年前
39、chen框架
由于后台使用了chen框架,所以代码不能完全列出,可以到http://git.oschina.net/eternal\_rider/chen(http://git.oschina.net/eternal_rider/chen)下载项目,运行后,即可看到菜单效果级管理。示例框架中写了一个jquery菜单插件实现,可以使用存html代码样式
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
美凌格栋栋酱 美凌格栋栋酱
5个月前
Oracle 分组与拼接字符串同时使用
SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(