This commit is contained in:
Pan 2018-10-15 13:11:07 +08:00
parent 0c7dd680c7
commit 711d67c1d3
1 changed files with 3 additions and 2 deletions

View File

@ -4,9 +4,10 @@ import articleAPI from './article'
import remoteSearchAPI from './remoteSearch'
import transactionAPI from './transaction'
// * 修复 Mock 情况下,设置 withCredentials = true且未被拦截的跨域请求丢失 Cookies 的问题
// 修复在使用 MockJS 情况下,设置 withCredentials = true且未被拦截的跨域请求丢失 Cookies 的问题
// https://github.com/nuysoft/Mock/issues/300
Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
Mock.XHR.prototype.send = function () {
Mock.XHR.prototype.send = function() {
if (this.custom.xhr) {
this.custom.xhr.withCredentials = this.withCredentials || false
}