2***@qq.com
2***@qq.com
  • 发布:2023-05-30 11:13
  • 更新:2024-02-29 17:28
  • 阅读:603

【报Bug】uni.request在h5端获取不到set-cookie的响应头

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

浏览器平台: Chrome

浏览器版本: 113

项目创建方式: CLI

CLI版本号: 3.0.0-alpha-308032023052300

示例代码:
  uni.addInterceptor("request", {  
    success({ data, statusCode, header, cookies }) {  
      console.log({ header });  
    }  
  });  
  const res = await uni.request({url:"/foo"})

操作步骤:
  uni.addInterceptor("request", {  
    success({ data, statusCode, header, cookies }) {  
      console.log({ header });  
    }  
  });  
  const res = await uni.request({url:"/foo"})

预期结果:

控制台header应该包括set-cookie

实际结果:

实际

access-control-allow-headers  
:   
"*"  
access-control-allow-methods  
:   
"GET, POST, OPTIONS"  
access-control-allow-origin  
:   
"*"  
cache-control  
:   
"no-store"  
connection  
:   
"close"  
content-encoding  
:   
"gzip"  
content-type  
:   
"text/plain; charset=utf-8"  
date  
:   
"Tue, 30 May 2023 03:06:56 GMT"  
server  
:   
"openresty/1.21.4.1"  
transfer-encoding  
:   
"chunked"  
vary  
:   
"Accept-Encoding"

bug描述:

看图1和图2

2023-05-30 11:13 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com

有结果了吗怎么解决的呀

要回复问题请先登录注册