https://stackoverflow.com/questions/7210507/ajax-post-error-refused-to-set-unsafe-header-connection/7210840

Remove these two lines:

xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");

XMLHttpRequest isn't allowed to set these headers, they are being set automatically by the browser. The reason is that by manipulating these headers you might be able to trick the server into accepting a second request through the same connection, one that wouldn't go through the usual security checks - that would be a security vulnerability in the browser.

// request interceptor
service.interceptors.request.use(
    config => {
        // do something before request is sent
        // console.log(store.getters.token)
        config.headers['Access-Control-Allow-Origin'] = '*'
        config.headers['cache-control'] = 'max-age=1,s-maxage=1'
        config.headers['Cookie'] = 'noBy-interceptors.request'

最新文章

  1. C#设计模式系列:简单工厂模式(Simple Factory)
  2. (转)SVN服务器搭建和使用(二)
  3. java 之前的安全的类回顾,以及以后需要线程安全时使用哪些类
  4. kafka原理存储
  5. IMS Global Learning Tools Interoperability™ Implementation Guide
  6. OSGI.NET 学习笔记(一)
  7. mysql颠覆实战笔记(二)-- 用户登录(一):唯一索引的妙用
  8. jQuery 使用 jQuery UI 部件工厂编写带状态的插件(翻译)
  9. Qt在Mac OS X下的编程环境搭建
  10. MyEclipse使用经验归纳
  11. iOS 从url中获取文件名以及后缀
  12. css常用的属性方法 上篇
  13. 【Android Developers Training】 81. 解析XML数据
  14. Spring3 MVC
  15. Celery异步的分布式任务调度理解
  16. VueJs相关学习网址
  17. 要求根据RandomStr.java:使用类型转换生成六位验证字符串,示例程序每次运 行时,都会生成不同的字符串。
  18. 简单明了区分IE,Firefox,chrome主流浏览器
  19. 007.MySQL-Keepalived搭配脚本01
  20. 广告狂人第一至七季/全集Mad Men迅雷下载

热门文章

  1. CentOS7怎样安装MySQL5.7.22
  2. SQL 必知必会笔记--完整介绍sql技巧
  3. Django --- 多对多关系创建,forms组件
  4. 3D-2D透视投影数学推导
  5. python字符串、字符串处理函数及字符串相关操作
  6. 【mssql】增删改查笔记
  7. 利用fgetc合并2个源文件的内容,到一个新的文件中
  8. pyy整队 线段树
  9. Random Target Moving~
  10. 42、JDBC数据源案例