From 61987f982f8c43c311b4a87fb83d0acfa21105f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Thu, 21 Feb 2019 16:56:23 +0800 Subject: [PATCH] fixed request.init --- src/request/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/request/index.js b/src/request/index.js index 24fe915..921f473 100644 --- a/src/request/index.js +++ b/src/request/index.js @@ -89,7 +89,7 @@ class _Request { this.cancel = true this.xhr.abort() } - this.__next__(Object.assign({}, this.__INIT__, param)) + this.__next__(Object.assign({}, request.__INIT__, param)) return this.defer.promise } @@ -423,6 +423,10 @@ if (!window.request) { return this.get(url, param) }, open(url, method = 'GET', param = {}) { + if (typeof method === 'object') { + param = method + method = 'GET' + } return new _Request(url, method, param) }, version: '2.0.0-normal',