Mock
Mock copied to clipboard
fix withCredentials=true
修复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()
之后,并不会执行将自定义属性赋值给原生的过程