解决mockjs导致没有匹配拦截的请求withCredentials属性无效,丢失cookie
import Mock from 'mockjs'
Mock.XHR.prototype._original_send = Mock.XHR.prototype.send
Mock.XHR.prototype.send = function() {
if (this.custom.xhr) {
this.custom.xhr.withCredentials = this.withCredentials || false
}
this._original_send(...arguments)
}