Skip to content

Conversation

@phillyx
Copy link

@phillyx phillyx commented May 31, 2021

修复xhr.withCredentials = true 不生效的bug
下方写法不生效

      const xhr = new XMLHttpRequest()
      xhr.open('GET', url)
      xhr.withCredentials = true
      xhr.send()

xhr.withCredentials = true写在xhr.open()之前生效,是因为下方node_modules/mockjs/src/mock/xhr/xhr.js line226行for循环在起作用

同理,将xhr.withCredentials = true写在xhr.open()之后,并不会执行将自定义属性赋值给原生的过程

fix withCredentials=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant