@whitesev/utils 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.amd.js +23 -15
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +23 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +23 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +23 -15
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +23 -15
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +23 -15
- package/dist/index.umd.js.map +1 -1
- package/package.json +10 -2
- package/index.ts +0 -3
- package/rollup.config.js +0 -57
- package/src/AjaxHookerType.ts +0 -155
- package/src/ColorConversion.ts +0 -130
- package/src/Dictionary.ts +0 -152
- package/src/Event.ts +0 -189
- package/src/GBKEncoder.ts +0 -120
- package/src/Hooks.ts +0 -87
- package/src/Httpx.ts +0 -2402
- package/src/LockFunction.ts +0 -67
- package/src/Log.ts +0 -284
- package/src/Progress.ts +0 -143
- package/src/TryCatch.ts +0 -107
- package/src/Utils.ts +0 -4917
- package/src/UtilsCommon.ts +0 -20
- package/src/UtilsCore.ts +0 -47
- package/src/UtilsGMCookie.ts +0 -261
- package/src/UtilsGMMenu.ts +0 -530
- package/src/VueObject.ts +0 -128
- package/src/ajaxHooker/ajaxHooker.js +0 -566
- package/src/indexedDB.ts +0 -419
- package/tsconfig.json +0 -31
package/dist/index.iife.js
CHANGED
|
@@ -1566,11 +1566,13 @@ var Utils = (function () {
|
|
|
1566
1566
|
* @private
|
|
1567
1567
|
*/
|
|
1568
1568
|
beforeRequestCallBack(details) {
|
|
1569
|
-
if (
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1569
|
+
if (details.allowInterceptConfig) {
|
|
1570
|
+
// 首先配置得存在,不然默认允许拦截
|
|
1571
|
+
if (typeof details.allowInterceptConfig.beforeRequest === "boolean" &&
|
|
1572
|
+
!details.allowInterceptConfig.beforeRequest) {
|
|
1573
|
+
// 设置了禁止拦截
|
|
1574
|
+
return details;
|
|
1575
|
+
}
|
|
1574
1576
|
}
|
|
1575
1577
|
for (let index = 0; index < this.$config.configList.length; index++) {
|
|
1576
1578
|
let item = this.$config.configList[index];
|
|
@@ -1633,11 +1635,14 @@ var Utils = (function () {
|
|
|
1633
1635
|
* @param details 请求的配置
|
|
1634
1636
|
*/
|
|
1635
1637
|
successResponseCallBack(response, details) {
|
|
1636
|
-
if (
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1638
|
+
if (details.allowInterceptConfig) {
|
|
1639
|
+
// 首先配置得存在,不然默认允许拦截
|
|
1640
|
+
if (typeof details.allowInterceptConfig.afterResponseSuccess ===
|
|
1641
|
+
"boolean" &&
|
|
1642
|
+
!details.allowInterceptConfig.afterResponseSuccess) {
|
|
1643
|
+
// 设置了禁止拦截
|
|
1644
|
+
return details;
|
|
1645
|
+
}
|
|
1641
1646
|
}
|
|
1642
1647
|
for (let index = 0; index < this.$config.configList.length; index++) {
|
|
1643
1648
|
let item = this.$config.configList[index];
|
|
@@ -1654,11 +1659,14 @@ var Utils = (function () {
|
|
|
1654
1659
|
* @param data 配置
|
|
1655
1660
|
*/
|
|
1656
1661
|
errorResponseCallBack(data) {
|
|
1657
|
-
if (
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
+
if (data.details.allowInterceptConfig) {
|
|
1663
|
+
// 首先配置得存在,不然默认允许拦截
|
|
1664
|
+
if (typeof data.details.allowInterceptConfig.afterResponseError ===
|
|
1665
|
+
"boolean" &&
|
|
1666
|
+
!data.details.allowInterceptConfig.afterResponseError) {
|
|
1667
|
+
// 设置了禁止拦截
|
|
1668
|
+
return data;
|
|
1669
|
+
}
|
|
1662
1670
|
}
|
|
1663
1671
|
for (let index = 0; index < this.$config.configList.length; index++) {
|
|
1664
1672
|
let item = this.$config.configList[index];
|