This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

fixed request.init

old
宇天 2019-02-21 16:56:23 +08:00
parent 424f9dbd9e
commit 61987f982f
1 changed files with 5 additions and 1 deletions

View File

@ -89,7 +89,7 @@ class _Request {
this.cancel = true this.cancel = true
this.xhr.abort() this.xhr.abort()
} }
this.__next__(Object.assign({}, this.__INIT__, param)) this.__next__(Object.assign({}, request.__INIT__, param))
return this.defer.promise return this.defer.promise
} }
@ -423,6 +423,10 @@ if (!window.request) {
return this.get(url, param) return this.get(url, param)
}, },
open(url, method = 'GET', param = {}) { open(url, method = 'GET', param = {}) {
if (typeof method === 'object') {
param = method
method = 'GET'
}
return new _Request(url, method, param) return new _Request(url, method, param)
}, },
version: '2.0.0-normal', version: '2.0.0-normal',