Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3版本请求带上cookie #620

Open
2 tasks done
bailihuiyue opened this issue Dec 31, 2024 · 1 comment
Open
2 tasks done

v3版本请求带上cookie #620

bailihuiyue opened this issue Dec 31, 2024 · 1 comment
Assignees
Labels
bug:need-confirm It's probably a bug lang:chinese This issue uses Chinese

Comments

@bailihuiyue
Copy link

这是否是一个 Bug?

  • 我已经确认我要报告的是一个 Bug

这个问题是否已经存在?

  • 我已经确认这个 Issue 没有被报告过

Alova 版本

3.0.13

前端框架

Vue

问题描述

大佬打扰了,我的alova是3.0.13版本,我想让请求带上cookie

createAlova({
  ...
  requestAdapter: adapterFetch(),
  beforeRequest(method) {
    method.config.credentials = 'include'
    method.config.referrerPolicy = 'no-referrer'
    method.config.mode = 'cors'
  }
})

这样写不管用呢,请问哪里不对呢

期望的表现

No response

复现链接

No response

复现步骤

大佬打扰了,我的alova是3.0.13版本,我想让请求带上cookie

createAlova({
  ...
  requestAdapter: adapterFetch(),
  beforeRequest(method) {
    method.config.credentials = 'include'
    method.config.referrerPolicy = 'no-referrer'
    method.config.mode = 'cors'
  }
})

这样写不管用呢,请问哪里不对呢

系统信息

No response

补充说明

No response

@bailihuiyue bailihuiyue added bug:need-confirm It's probably a bug lang:chinese This issue uses Chinese labels Dec 31, 2024
@MeetinaXD
Copy link
Contributor

跨域cookie需要服务端设置正确的响应头。

跨源资源共享

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:need-confirm It's probably a bug lang:chinese This issue uses Chinese
Projects
None yet
Development

No branches or pull requests

2 participants