Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
bdf20de1
U
uni-app
项目概览
陈庄旺
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bdf20de1
编写于
9月 28, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add interceptors
上级
78ea1a78
变更
21
展开全部
隐藏空白更改
内联
并排
Showing
21 changed file
with
173 addition
and
85 deletion
+173
-85
packages/uni-api/src/service/base/interceptor.ts
packages/uni-api/src/service/base/interceptor.ts
+2
-21
packages/uni-app-plus/dist/style.css
packages/uni-app-plus/dist/style.css
+1
-1
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+39
-19
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+1
-1
packages/uni-app-plus/src/service/api/index.ts
packages/uni-app-plus/src/service/api/index.ts
+1
-1
packages/uni-app/dist/uni-app.cjs.js
packages/uni-app/dist/uni-app.cjs.js
+1
-1
packages/uni-h5-vite/lib/api.json
packages/uni-h5-vite/lib/api.json
+1
-1
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+25
-1
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+39
-28
packages/uni-h5/src/service/api/index.ts
packages/uni-h5/src/service/api/index.ts
+1
-1
packages/uni-mp-alipay/dist/uni.api.esm.js
packages/uni-mp-alipay/dist/uni.api.esm.js
+3
-1
packages/uni-mp-baidu/dist/uni.api.esm.js
packages/uni-mp-baidu/dist/uni.api.esm.js
+3
-1
packages/uni-mp-core/src/api/index.ts
packages/uni-mp-core/src/api/index.ts
+2
-0
packages/uni-mp-kuaishou/dist/uni.api.esm.js
packages/uni-mp-kuaishou/dist/uni.api.esm.js
+3
-1
packages/uni-mp-qq/dist/uni.api.esm.js
packages/uni-mp-qq/dist/uni.api.esm.js
+3
-1
packages/uni-mp-toutiao/dist/uni.api.esm.js
packages/uni-mp-toutiao/dist/uni.api.esm.js
+3
-1
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+37
-1
packages/uni-mp-weixin/dist/uni.api.esm.js
packages/uni-mp-weixin/dist/uni.api.esm.js
+3
-1
packages/uni-quickapp-webview/dist/uni.api.esm.js
packages/uni-quickapp-webview/dist/uni.api.esm.js
+3
-1
packages/uni-stat/dist/uni-stat.cjs.js
packages/uni-stat/dist/uni-stat.cjs.js
+1
-1
packages/uni-stat/dist/uni-stat.es.js
packages/uni-stat/dist/uni-stat.es.js
+1
-1
未找到文件。
packages/uni-api/src/service/base/interceptor.ts
浏览文件 @
bdf20de1
import
{
isArray
,
isFunction
,
isP
romise
,
isP
lainObject
}
from
'
@vue/shared
'
import
{
isArray
,
isFunction
,
isPlainObject
}
from
'
@vue/shared
'
import
{
HOOKS
,
...
...
@@ -113,23 +113,4 @@ export const removeInterceptor = defineSyncApi(
RemoveInterceptorProtocol
)
const
promiseInterceptor
=
{
returnValue
(
res
:
unknown
)
{
if
(
!
isPromise
(
res
))
{
return
res
}
return
new
Promise
((
resolve
,
reject
)
=>
{
res
.
then
((
res
)
=>
{
if
(
res
[
0
])
{
reject
(
res
[
0
])
}
else
{
resolve
(
res
[
1
])
}
})
})
},
}
export
const
interceptors
=
{
promiseInterceptor
,
}
export
const
interceptors
=
{}
packages/uni-app-plus/dist/style.css
浏览文件 @
bdf20de1
此差异已折叠。
点击以展开。
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
bdf20de1
...
...
@@ -2732,23 +2732,7 @@ var serviceContext = (function (vue) {
removeInterceptorHook(globalInterceptors, method);
}
}, RemoveInterceptorProtocol);
const promiseInterceptor = {
returnValue(res) {
if (!isPromise(res)) {
return res;
}
return new Promise((resolve, reject) => {
res.then((res) => {
if (res[0]) {
reject(res[0]);
}
else {
resolve(res[1]);
}
});
});
},
};
const interceptors = {};
const API_ON = '$on';
const OnProtocol = [
...
...
@@ -9942,8 +9926,44 @@ var serviceContext = (function (vue) {
});
}
let realAtob;
const b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
if (typeof atob !== 'function') {
realAtob = function (str) {
str = String(str).replace(/[\t\n\f\r ]+/g, '');
if (!b64re.test(str)) {
throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
}
// Adding the padding if missing, for semplicity
str += '=='.slice(2 - (str.length & 3));
var bitmap;
var result = '';
var r1;
var r2;
var i = 0;
for (; i < str.length;) {
bitmap =
(b64.indexOf(str.charAt(i++)) << 18) |
(b64.indexOf(str.charAt(i++)) << 12) |
((r1 = b64.indexOf(str.charAt(i++))) << 6) |
(r2 = b64.indexOf(str.charAt(i++)));
result +=
r1 === 64
? String.fromCharCode((bitmap >> 16) & 255)
: r2 === 64
? String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255)
: String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255, bitmap & 255);
}
return result;
};
}
else {
// 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
realAtob = atob;
}
function b64DecodeUnicode(str) {
return decodeURIComponent(
a
tob(str)
return decodeURIComponent(
realA
tob(str)
.split('')
.map(function (c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
...
...
@@ -12573,7 +12593,7 @@ var serviceContext = (function (vue) {
upx2px: upx2px,
addInterceptor: addInterceptor,
removeInterceptor: removeInterceptor,
promiseInterceptor: promiseInterceptor
,
interceptors: interceptors
,
arrayBufferToBase64: arrayBufferToBase64,
base64ToArrayBuffer: base64ToArrayBuffer,
createIntersectionObserver: createIntersectionObserver,
...
...
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
bdf20de1
此差异已折叠。
点击以展开。
packages/uni-app-plus/src/service/api/index.ts
浏览文件 @
bdf20de1
...
...
@@ -80,7 +80,7 @@ export {
upx2px
,
addInterceptor
,
removeInterceptor
,
promiseInterceptor
,
interceptors
,
arrayBufferToBase64
,
base64ToArrayBuffer
,
createIntersectionObserver
,
...
...
packages/uni-app/dist/uni-app.cjs.js
浏览文件 @
bdf20de1
...
...
@@ -70,7 +70,7 @@ const ssrServerRef = (value, key, shallow = false) => {
state
=
globalData
;
}
state
[
key
]
=
sanitise
(
value
);
// SSR 模式下 watchEffect 不生效 https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/apiWatch.ts#L2
5
3
// SSR 模式下 watchEffect 不生效 https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/apiWatch.ts#L2
8
3
// 故自定义ref
return
vue
.
customRef
((
track
,
trigger
)
=>
{
const
customTrigger
=
()
=>
(
trigger
(),
(
state
[
key
]
=
sanitise
(
value
)));
...
...
packages/uni-h5-vite/lib/api.json
浏览文件 @
bdf20de1
...
...
@@ -61,6 +61,7 @@
"hideTabBarRedDot"
,
"hideToast"
,
"hideTopWindow"
,
"interceptors"
,
"loadFontFace"
,
"login"
,
"makePhoneCall"
,
...
...
@@ -89,7 +90,6 @@
"pageScrollTo"
,
"preloadPage"
,
"previewImage"
,
"promiseInterceptor"
,
"reLaunch"
,
"redirectTo"
,
"removeInterceptor"
,
...
...
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
bdf20de1
...
...
@@ -6539,8 +6539,32 @@ function initOptionMergeStrategies(optionMergeStrategies) {
optionMergeStrategies
[
name
]
=
mergeAsArray
;
});
}
let
realAtob
;
const
b64
=
"
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
"
;
const
b64re
=
/^
(?:[
A-Za-z
\d
+
/]{4})
*
?(?:[
A-Za-z
\d
+
/]{2}(?:
==
)?
|
[
A-Za-z
\d
+
/]{3}
=
?)?
$/
;
if
(
typeof
atob
!==
"
function
"
)
{
realAtob
=
function
(
str
)
{
str
=
String
(
str
).
replace
(
/
[\t\n\f\r
]
+/g
,
""
);
if
(
!
b64re
.
test
(
str
))
{
throw
new
Error
(
"
Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
"
);
}
str
+=
"
==
"
.
slice
(
2
-
(
str
.
length
&
3
));
var
bitmap
;
var
result
=
""
;
var
r1
;
var
r2
;
var
i
=
0
;
for
(;
i
<
str
.
length
;
)
{
bitmap
=
b64
.
indexOf
(
str
.
charAt
(
i
++
))
<<
18
|
b64
.
indexOf
(
str
.
charAt
(
i
++
))
<<
12
|
(
r1
=
b64
.
indexOf
(
str
.
charAt
(
i
++
)))
<<
6
|
(
r2
=
b64
.
indexOf
(
str
.
charAt
(
i
++
)));
result
+=
r1
===
64
?
String
.
fromCharCode
(
bitmap
>>
16
&
255
)
:
r2
===
64
?
String
.
fromCharCode
(
bitmap
>>
16
&
255
,
bitmap
>>
8
&
255
)
:
String
.
fromCharCode
(
bitmap
>>
16
&
255
,
bitmap
>>
8
&
255
,
bitmap
&
255
);
}
return
result
;
};
}
else
{
realAtob
=
atob
;
}
function
b64DecodeUnicode
(
str
)
{
return
decodeURIComponent
(
a
tob
(
str
).
split
(
""
).
map
(
function
(
c
)
{
return
decodeURIComponent
(
realA
tob
(
str
).
split
(
""
).
map
(
function
(
c
)
{
return
"
%
"
+
(
"
00
"
+
c
.
charCodeAt
(
0
).
toString
(
16
)).
slice
(
-
2
);
}).
join
(
""
));
}
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
bdf20de1
...
...
@@ -2455,9 +2455,9 @@ function queue(hooks, data) {
}
};
}
function wrapperOptions(interceptors, options = {}) {
function wrapperOptions(interceptors
2
, options = {}) {
[HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => {
const hooks = interceptors[name];
const hooks = interceptors
2
[name];
if (!isArray(hooks)) {
return;
}
...
...
@@ -2766,20 +2766,20 @@ const AddInterceptorProtocol = [
}
];
const RemoveInterceptorProtocol = AddInterceptorProtocol;
function mergeInterceptorHook(interceptors, interceptor) {
function mergeInterceptorHook(interceptors
2
, interceptor) {
Object.keys(interceptor).forEach((hook) => {
if (isFunction(interceptor[hook])) {
interceptors
[hook] = mergeHook(interceptors
[hook], interceptor[hook]);
interceptors
2[hook] = mergeHook(interceptors2
[hook], interceptor[hook]);
}
});
}
function removeInterceptorHook(interceptors, interceptor) {
if (!interceptors || !interceptor) {
function removeInterceptorHook(interceptors
2
, interceptor) {
if (!interceptors
2
|| !interceptor) {
return;
}
Object.keys(interceptor).forEach((hook) => {
if (isFunction(interceptor[hook])) {
removeHook(interceptors[hook], interceptor[hook]);
removeHook(interceptors
2
[hook], interceptor[hook]);
}
});
}
...
...
@@ -2823,22 +2823,7 @@ const removeInterceptor = /* @__PURE__ */ defineSyncApi(API_REMOVE_INTERCEPTOR,
removeInterceptorHook(globalInterceptors, method);
}
}, RemoveInterceptorProtocol);
const promiseInterceptor = {
returnValue(res) {
if (!isPromise(res)) {
return res;
}
return new Promise((resolve, reject) => {
res.then((res2) => {
if (res2[0]) {
reject(res2[0]);
} else {
resolve(res2[1]);
}
});
});
}
};
const interceptors = {};
const API_ON = "$on";
const OnProtocol = [
{
...
...
@@ -11825,8 +11810,10 @@ function useScrollViewLoader(props2, state2, scrollTopNumber, scrollLeftNumber,
state2.refreshState = _state;
}
onMounted(() => {
_scrollTopChanged(scrollTopNumber.value);
_scrollLeftChanged(scrollLeftNumber.value);
nextTick(() => {
_scrollTopChanged(scrollTopNumber.value);
_scrollLeftChanged(scrollLeftNumber.value);
});
_scrollIntoViewChanged(props2.scrollIntoView);
let __handleScroll = function(event) {
event.stopPropagation();
...
...
@@ -13257,8 +13244,32 @@ function initOptionMergeStrategies(optionMergeStrategies) {
optionMergeStrategies[name] = mergeAsArray;
});
}
let realAtob;
const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
if (typeof atob !== "function") {
realAtob = function(str) {
str = String(str).replace(/[\t\n\f\r ]+/g, "");
if (!b64re.test(str)) {
throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
}
str += "==".slice(2 - (str.length & 3));
var bitmap;
var result = "";
var r1;
var r2;
var i = 0;
for (; i < str.length; ) {
bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
}
return result;
};
} else {
realAtob = atob;
}
function b64DecodeUnicode(str) {
return decodeURIComponent(
a
tob(str).split("").map(function(c) {
return decodeURIComponent(
realA
tob(str).split("").map(function(c) {
return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2);
}).join(""));
}
...
...
@@ -19345,7 +19356,7 @@ var api = {
upx2px,
addInterceptor,
removeInterceptor,
promiseInterceptor
,
interceptors
,
arrayBufferToBase64,
base64ToArrayBuffer,
createIntersectionObserver,
...
...
@@ -21527,4 +21538,4 @@ var index = /* @__PURE__ */ defineSystemComponent({
return openBlock(), createBlock("div", clazz, [loadingVNode]);
}
});
export { $emit, $off, $on, $once, index$8 as Ad, index$7 as AdContentPage, index$6 as AdDraw, index$1 as AsyncErrorComponent, index as AsyncLoadingComponent, index$y as Button, index$5 as Camera, index$w as Canvas, index$u as Checkbox, index$v as CheckboxGroup, index$a as CoverImage, index$b as CoverView, index$t as Editor, index$A as Form, index$s as Icon, index$r as Image, Input, index$z as Label, LayoutComponent, index$4 as LivePlayer, index$3 as LivePusher, Map$1 as Map, MovableArea, MovableView, index$q as Navigator, index$2 as PageComponent, index$9 as Picker, PickerView, PickerViewColumn, index$p as Progress, index$n as Radio, index$o as RadioGroup, ResizeSensor, index$m as RichText, ScrollView, index$l as Slider, Swiper, SwiperItem, index$k as Switch, index$j as Text, index$i as Textarea, UniServiceJSBridge$1 as UniServiceJSBridge, UniViewJSBridge$1 as UniViewJSBridge, index$e as Video, index$h as View, index$d as WebView, addInterceptor, addPhoneContact, arrayBufferToBase64, base64ToArrayBuffer, canIUse, canvasGetImageData, canvasPutImageData, canvasToTempFilePath, chooseFile, chooseImage, chooseLocation, chooseVideo, clearStorage, clearStorageSync, closeSocket, connectSocket, createAnimation$1 as createAnimation, createCameraContext, createCanvasContext, createInnerAudioContext, createIntersectionObserver, createLivePlayerContext, createMapContext, createMediaQueryObserver, createSelectorQuery, createVideoContext, cssBackdropFilter, cssConstant, cssEnv, cssVar, downloadFile, getApp$1 as getApp, getCurrentPages$1 as getCurrentPages, getFileInfo, getImageInfo, getLeftWindowStyle, getLocale, getLocation, getNetworkType, getProvider, getRealPath, getRecorderManager, getRightWindowStyle, getSavedFileInfo, getSavedFileList, getScreenBrightness, getSelectedTextRange$1 as getSelectedTextRange, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getTopWindowStyle, getVideoInfo, hideKeyboard, hideLeftWindow, hideLoading, hideNavigationBarLoading, hideRightWindow, hideTabBar, hideTabBarRedDot, hideToast, hideTopWindow,
loadFontFace, login, makePhoneCall, navigateBack, navigateTo, offAccelerometerChange, offCompassChange, offNetworkStatusChange, offWindowResize, onAccelerometerChange, onAppLaunch, onCompassChange, onGyroscopeChange, onLocaleChange, onMemoryWarning, onNetworkStatusChange, onSocketClose, onSocketError, onSocketMessage, onSocketOpen, onTabBarMidButtonTap, onUserCaptureScreen, onWindowResize, openDocument, openLocation, pageScrollTo, index$f as plugin, preloadPage, previewImage, promiseInterceptor
, reLaunch, redirectTo, removeInterceptor, removeSavedFileInfo, removeStorage, removeStorageSync, removeTabBarBadge, request, saveFile, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, sendSocketMessage, setKeepScreenOn, setLeftWindowStyle, setLocale, setNavigationBarColor, setNavigationBarTitle, setRightWindowStyle, setScreenBrightness, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setTopWindowStyle, setupApp, setupPage, setupWindow, showActionSheet, showLeftWindow, showLoading, showModal, showNavigationBarLoading, showRightWindow, showTabBar, showTabBarRedDot, showToast, showTopWindow, startAccelerometer, startCompass, startGyroscope, startPullDownRefresh, stopAccelerometer, stopCompass, stopGyroscope, stopPullDownRefresh, switchTab, uni$1 as uni, uploadFile, upx2px, useI18n, useTabBar, vibrateLong, vibrateShort };
export { $emit, $off, $on, $once, index$8 as Ad, index$7 as AdContentPage, index$6 as AdDraw, index$1 as AsyncErrorComponent, index as AsyncLoadingComponent, index$y as Button, index$5 as Camera, index$w as Canvas, index$u as Checkbox, index$v as CheckboxGroup, index$a as CoverImage, index$b as CoverView, index$t as Editor, index$A as Form, index$s as Icon, index$r as Image, Input, index$z as Label, LayoutComponent, index$4 as LivePlayer, index$3 as LivePusher, Map$1 as Map, MovableArea, MovableView, index$q as Navigator, index$2 as PageComponent, index$9 as Picker, PickerView, PickerViewColumn, index$p as Progress, index$n as Radio, index$o as RadioGroup, ResizeSensor, index$m as RichText, ScrollView, index$l as Slider, Swiper, SwiperItem, index$k as Switch, index$j as Text, index$i as Textarea, UniServiceJSBridge$1 as UniServiceJSBridge, UniViewJSBridge$1 as UniViewJSBridge, index$e as Video, index$h as View, index$d as WebView, addInterceptor, addPhoneContact, arrayBufferToBase64, base64ToArrayBuffer, canIUse, canvasGetImageData, canvasPutImageData, canvasToTempFilePath, chooseFile, chooseImage, chooseLocation, chooseVideo, clearStorage, clearStorageSync, closeSocket, connectSocket, createAnimation$1 as createAnimation, createCameraContext, createCanvasContext, createInnerAudioContext, createIntersectionObserver, createLivePlayerContext, createMapContext, createMediaQueryObserver, createSelectorQuery, createVideoContext, cssBackdropFilter, cssConstant, cssEnv, cssVar, downloadFile, getApp$1 as getApp, getCurrentPages$1 as getCurrentPages, getFileInfo, getImageInfo, getLeftWindowStyle, getLocale, getLocation, getNetworkType, getProvider, getRealPath, getRecorderManager, getRightWindowStyle, getSavedFileInfo, getSavedFileList, getScreenBrightness, getSelectedTextRange$1 as getSelectedTextRange, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getTopWindowStyle, getVideoInfo, hideKeyboard, hideLeftWindow, hideLoading, hideNavigationBarLoading, hideRightWindow, hideTabBar, hideTabBarRedDot, hideToast, hideTopWindow,
interceptors, loadFontFace, login, makePhoneCall, navigateBack, navigateTo, offAccelerometerChange, offCompassChange, offNetworkStatusChange, offWindowResize, onAccelerometerChange, onAppLaunch, onCompassChange, onGyroscopeChange, onLocaleChange, onMemoryWarning, onNetworkStatusChange, onSocketClose, onSocketError, onSocketMessage, onSocketOpen, onTabBarMidButtonTap, onUserCaptureScreen, onWindowResize, openDocument, openLocation, pageScrollTo, index$f as plugin, preloadPage, previewImage
, reLaunch, redirectTo, removeInterceptor, removeSavedFileInfo, removeStorage, removeStorageSync, removeTabBarBadge, request, saveFile, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, sendSocketMessage, setKeepScreenOn, setLeftWindowStyle, setLocale, setNavigationBarColor, setNavigationBarTitle, setRightWindowStyle, setScreenBrightness, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setTopWindowStyle, setupApp, setupPage, setupWindow, showActionSheet, showLeftWindow, showLoading, showModal, showNavigationBarLoading, showRightWindow, showTabBar, showTabBarRedDot, showToast, showTopWindow, startAccelerometer, startCompass, startGyroscope, startPullDownRefresh, stopAccelerometer, stopCompass, stopGyroscope, stopPullDownRefresh, switchTab, uni$1 as uni, uploadFile, upx2px, useI18n, useTabBar, vibrateLong, vibrateShort };
packages/uni-h5/src/service/api/index.ts
浏览文件 @
bdf20de1
...
...
@@ -68,7 +68,7 @@ export {
upx2px
,
addInterceptor
,
removeInterceptor
,
promiseInterceptor
,
interceptors
,
arrayBufferToBase64
,
base64ToArrayBuffer
,
createIntersectionObserver
,
...
...
packages/uni-mp-alipay/dist/uni.api.esm.js
浏览文件 @
bdf20de1
...
...
@@ -473,7 +473,8 @@ const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interce
else
if
(
isPlainObject
(
method
))
{
removeInterceptorHook
(
globalInterceptors
,
method
);
}
},
RemoveInterceptorProtocol
);
},
RemoveInterceptorProtocol
);
const
interceptors
=
{};
const
API_ON
=
'
$on
'
;
const
OnProtocol
=
[
...
...
@@ -761,6 +762,7 @@ const baseApis = {
$once
,
$emit
,
upx2px
,
interceptors
,
addInterceptor
,
removeInterceptor
,
onAppLaunch
,
...
...
packages/uni-mp-baidu/dist/uni.api.esm.js
浏览文件 @
bdf20de1
...
...
@@ -473,7 +473,8 @@ const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interce
else
if
(
isPlainObject
(
method
))
{
removeInterceptorHook
(
globalInterceptors
,
method
);
}
},
RemoveInterceptorProtocol
);
},
RemoveInterceptorProtocol
);
const
interceptors
=
{};
const
API_ON
=
'
$on
'
;
const
OnProtocol
=
[
...
...
@@ -761,6 +762,7 @@ const baseApis = {
$once
,
$emit
,
upx2px
,
interceptors
,
addInterceptor
,
removeInterceptor
,
onAppLaunch
,
...
...
packages/uni-mp-core/src/api/index.ts
浏览文件 @
bdf20de1
...
...
@@ -4,6 +4,7 @@ import { upx2px } from '@dcloudio/uni-api/src/service/base/upx2px'
import
{
addInterceptor
,
removeInterceptor
,
interceptors
,
}
from
'
@dcloudio/uni-api/src/service/base/interceptor
'
import
{
$on
,
...
...
@@ -24,6 +25,7 @@ const baseApis = {
$once
,
$emit
,
upx2px
,
interceptors
,
addInterceptor
,
removeInterceptor
,
onAppLaunch
,
...
...
packages/uni-mp-kuaishou/dist/uni.api.esm.js
浏览文件 @
bdf20de1
...
...
@@ -473,7 +473,8 @@ const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interce
else
if
(
isPlainObject
(
method
))
{
removeInterceptorHook
(
globalInterceptors
,
method
);
}
},
RemoveInterceptorProtocol
);
},
RemoveInterceptorProtocol
);
const
interceptors
=
{};
const
API_ON
=
'
$on
'
;
const
OnProtocol
=
[
...
...
@@ -761,6 +762,7 @@ const baseApis = {
$once
,
$emit
,
upx2px
,
interceptors
,
addInterceptor
,
removeInterceptor
,
onAppLaunch
,
...
...
packages/uni-mp-qq/dist/uni.api.esm.js
浏览文件 @
bdf20de1
...
...
@@ -473,7 +473,8 @@ const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interce
else
if
(
isPlainObject
(
method
))
{
removeInterceptorHook
(
globalInterceptors
,
method
);
}
},
RemoveInterceptorProtocol
);
},
RemoveInterceptorProtocol
);
const
interceptors
=
{};
const
API_ON
=
'
$on
'
;
const
OnProtocol
=
[
...
...
@@ -761,6 +762,7 @@ const baseApis = {
$once
,
$emit
,
upx2px
,
interceptors
,
addInterceptor
,
removeInterceptor
,
onAppLaunch
,
...
...
packages/uni-mp-toutiao/dist/uni.api.esm.js
浏览文件 @
bdf20de1
...
...
@@ -473,7 +473,8 @@ const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interce
else
if
(
isPlainObject
(
method
))
{
removeInterceptorHook
(
globalInterceptors
,
method
);
}
},
RemoveInterceptorProtocol
);
},
RemoveInterceptorProtocol
);
const
interceptors
=
{};
const
API_ON
=
'
$on
'
;
const
OnProtocol
=
[
...
...
@@ -761,6 +762,7 @@ const baseApis = {
$once
,
$emit
,
upx2px
,
interceptors
,
addInterceptor
,
removeInterceptor
,
onAppLaunch
,
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
bdf20de1
...
...
@@ -4818,8 +4818,44 @@ function initOptionMergeStrategies(optionMergeStrategies) {
});
}
let
realAtob
;
const
b64
=
'
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
'
;
const
b64re
=
/^
(?:[
A-Za-z
\d
+
/]{4})
*
?(?:[
A-Za-z
\d
+
/]{2}(?:
==
)?
|
[
A-Za-z
\d
+
/]{3}
=
?)?
$/
;
if
(
typeof
atob
!==
'
function
'
)
{
realAtob
=
function
(
str
)
{
str
=
String
(
str
).
replace
(
/
[\t\n\f\r
]
+/g
,
''
);
if
(
!
b64re
.
test
(
str
))
{
throw
new
Error
(
"
Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
"
);
}
// Adding the padding if missing, for semplicity
str
+=
'
==
'
.
slice
(
2
-
(
str
.
length
&
3
));
var
bitmap
;
var
result
=
''
;
var
r1
;
var
r2
;
var
i
=
0
;
for
(;
i
<
str
.
length
;)
{
bitmap
=
(
b64
.
indexOf
(
str
.
charAt
(
i
++
))
<<
18
)
|
(
b64
.
indexOf
(
str
.
charAt
(
i
++
))
<<
12
)
|
((
r1
=
b64
.
indexOf
(
str
.
charAt
(
i
++
)))
<<
6
)
|
(
r2
=
b64
.
indexOf
(
str
.
charAt
(
i
++
)));
result
+=
r1
===
64
?
String
.
fromCharCode
((
bitmap
>>
16
)
&
255
)
:
r2
===
64
?
String
.
fromCharCode
((
bitmap
>>
16
)
&
255
,
(
bitmap
>>
8
)
&
255
)
:
String
.
fromCharCode
((
bitmap
>>
16
)
&
255
,
(
bitmap
>>
8
)
&
255
,
bitmap
&
255
);
}
return
result
;
};
}
else
{
// 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
realAtob
=
atob
;
}
function
b64DecodeUnicode
(
str
)
{
return
decodeURIComponent
(
a
tob
(
str
)
return
decodeURIComponent
(
realA
tob
(
str
)
.
split
(
''
)
.
map
(
function
(
c
)
{
return
'
%
'
+
(
'
00
'
+
c
.
charCodeAt
(
0
).
toString
(
16
)).
slice
(
-
2
);
...
...
packages/uni-mp-weixin/dist/uni.api.esm.js
浏览文件 @
bdf20de1
...
...
@@ -437,7 +437,8 @@ const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interce
else
if
(
isPlainObject
(
method
))
{
removeInterceptorHook
(
globalInterceptors
,
method
);
}
},
RemoveInterceptorProtocol
);
},
RemoveInterceptorProtocol
);
const
interceptors
=
{};
const
API_ON
=
'
$on
'
;
const
OnProtocol
=
[
...
...
@@ -725,6 +726,7 @@ const baseApis = {
$once
,
$emit
,
upx2px
,
interceptors
,
addInterceptor
,
removeInterceptor
,
onAppLaunch
,
...
...
packages/uni-quickapp-webview/dist/uni.api.esm.js
浏览文件 @
bdf20de1
...
...
@@ -473,7 +473,8 @@ const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interce
else
if
(
isPlainObject
(
method
))
{
removeInterceptorHook
(
globalInterceptors
,
method
);
}
},
RemoveInterceptorProtocol
);
},
RemoveInterceptorProtocol
);
const
interceptors
=
{};
const
API_ON
=
'
$on
'
;
const
OnProtocol
=
[
...
...
@@ -761,6 +762,7 @@ const baseApis = {
$once
,
$emit
,
upx2px
,
interceptors
,
addInterceptor
,
removeInterceptor
,
onAppLaunch
,
...
...
packages/uni-stat/dist/uni-stat.cjs.js
浏览文件 @
bdf20de1
'
use strict
'
;
var
version
=
"
3.0.0-alpha-302092021092
6
001
"
;
var
version
=
"
3.0.0-alpha-302092021092
7
001
"
;
const
STAT_VERSION
=
version
;
const
STAT_URL
=
'
https://tongji.dcloud.io/uni/stat
'
;
...
...
packages/uni-stat/dist/uni-stat.es.js
浏览文件 @
bdf20de1
var
version
=
"
3.0.0-alpha-302092021092
6
001
"
;
var
version
=
"
3.0.0-alpha-302092021092
7
001
"
;
const
STAT_VERSION
=
version
;
const
STAT_URL
=
'
https://tongji.dcloud.io/uni/stat
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录