karl-common-util
Advanced tools
Comparing version 1.5.7 to 1.5.8
@@ -237,10 +237,14 @@ "use strict"; | ||
} | ||
//如果是浏览器,则自动识别跨域模式 | ||
if (isBrowser && mode === undefined && (url.startsWith("http://") || url.startsWith("https://"))) { | ||
mode === "cors"; | ||
} | ||
if (!(times > 0)) { | ||
_context3.next = 19; | ||
_context3.next = 20; | ||
break; | ||
} | ||
_context3.prev = 2; | ||
_context3.next = 5; | ||
_context3.prev = 3; | ||
_context3.next = 6; | ||
return regeneratorRuntime.awrap(doFetch({ | ||
@@ -258,9 +262,9 @@ url: url, | ||
case 5: | ||
case 6: | ||
response = _context3.sent; | ||
return _context3.abrupt("return", response); | ||
case 9: | ||
_context3.prev = 9; | ||
_context3.t0 = _context3["catch"](2); | ||
case 10: | ||
_context3.prev = 10; | ||
_context3.t0 = _context3["catch"](3); | ||
@@ -270,7 +274,7 @@ times--; | ||
if (!(times > 0)) { | ||
_context3.next = 18; | ||
_context3.next = 19; | ||
break; | ||
} | ||
_context3.next = 15; | ||
_context3.next = 16; | ||
return regeneratorRuntime.awrap(request({ | ||
@@ -290,9 +294,9 @@ url: url, | ||
case 15: | ||
case 16: | ||
return _context3.abrupt("return", _context3.sent); | ||
case 18: | ||
case 19: | ||
throw _context3.t0; | ||
case 19: | ||
case 20: | ||
case "end": | ||
@@ -302,3 +306,3 @@ return _context3.stop(); | ||
} | ||
}, null, undefined, [[2, 9]]); | ||
}, null, undefined, [[3, 10]]); | ||
}; | ||
@@ -305,0 +309,0 @@ |
{ | ||
"name": "karl-common-util", | ||
"version": "1.5.7", | ||
"version": "1.5.8", | ||
"description": "karl common lib for client and server", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -142,2 +142,7 @@ import "isomorphic-fetch" | ||
} | ||
//如果是浏览器,则自动识别跨域模式 | ||
if (isBrowser && mode === undefined && (url.startsWith("http://") || url.startsWith("https://"))) { | ||
mode === "cors" | ||
} | ||
if (times > 0) { | ||
@@ -144,0 +149,0 @@ try { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64504
1542