no message

Former-commit-id: 8a1bbc6a42e8679d9edb3a2ee6e3d0a7022dec34
This commit is contained in:
liyang
2018-10-13 20:50:55 +08:00
parent 31d56143f5
commit 3929710809
2 changed files with 2 additions and 2 deletions
+10
View File
@@ -0,0 +1,10 @@
export default function (Mock) {
// 解决 Mock 情况下,携带 withCredentials = true,且未被拦截的跨域请求丢失 Cookies 的问题
Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
Mock.XHR.prototype.send = function () {
if (this.custom.xhr) {
this.custom.xhr.withCredentials = this.withCredentials || false
}
this.proxy_send(...arguments)
}
}