From 358c2777c1f2c210e77eb21380f764b24d232d01 Mon Sep 17 00:00:00 2001 From: liwei Date: Wed, 9 Oct 2019 14:38:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=B7=A8=E5=9F=9Fajax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e71e585..b3cc3be 100644 --- a/index.js +++ b/index.js @@ -15,6 +15,14 @@ const buildPromiseCommon = (asyncFunc, syncFunc, args) => { } export default { +/** + * 通过代理服务器模拟http请求,防止浏览器ajax跨域问题 + * @param {Object} request http请求 + */ + fetch(request) { + return buildPromiseCommon('fetchAsync', '', [request]) + }, + /** * 根据下载请求解析响应相关内容 * @param {Object} request 下载请求 diff --git a/package.json b/package.json index fa44e56..f5fd479 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "proxyee-down-extension-sdk", - "version": "1.0.10", + "version": "1.1.0", "description": "proxyee-down extension development js SDK.", "main": "index.js", "devDependencies": {