vue.config.js代理https请求头接口

proxy: {
      "/api": {
        target: 'https://example.com',
        changeOrigin: true, 
        secure: false,
        headers: {                  
          Referer: 'https://example.com'
        }
      }
 }
target 要使用 Proxy 包装的目标

secure 安全证书校验

Referer 表示请求的来源(必填)
 

转自https://www.cnblogs.com/roland-sky/p/12916645.html

posted on 2021-02-22 15:59  写最骚的代码  阅读(2447)  评论(0)    收藏  举报