Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
84634920
U
uni-app
项目概览
Velpro187
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
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,发现更多精彩内容 >>
提交
84634920
编写于
3月 31, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: createApi => defineApi
上级
9151b16f
变更
33
隐藏空白更改
内联
并排
Showing
33 changed file
with
118 addition
and
121 deletion
+118
-121
packages/uni-api/src/helpers/api/index.ts
packages/uni-api/src/helpers/api/index.ts
+9
-9
packages/uni-api/src/index.ts
packages/uni-api/src/index.ts
+4
-4
packages/uni-api/src/protocols/media/getImageInfo.ts
packages/uni-api/src/protocols/media/getImageInfo.ts
+2
-1
packages/uni-api/src/service/base/base64.ts
packages/uni-api/src/service/base/base64.ts
+3
-3
packages/uni-api/src/service/base/interceptor.ts
packages/uni-api/src/service/base/interceptor.ts
+3
-3
packages/uni-api/src/service/base/upx2px.ts
packages/uni-api/src/service/base/upx2px.ts
+2
-2
packages/uni-api/src/service/ui/createIntersectionObserver.ts
...ages/uni-api/src/service/ui/createIntersectionObserver.ts
+2
-2
packages/uni-h5/dist/uni-h5.esm.js
packages/uni-h5/dist/uni-h5.esm.js
+28
-32
packages/uni-h5/src/service/api/base/canIUse.ts
packages/uni-h5/src/service/api/base/canIUse.ts
+2
-2
packages/uni-h5/src/service/api/device/getSystemInfo.ts
packages/uni-h5/src/service/api/device/getSystemInfo.ts
+2
-2
packages/uni-h5/src/service/api/device/getSystemInfoSync.ts
packages/uni-h5/src/service/api/device/getSystemInfoSync.ts
+2
-2
packages/uni-h5/src/service/api/device/makePhoneCall.ts
packages/uni-h5/src/service/api/device/makePhoneCall.ts
+2
-2
packages/uni-h5/src/service/api/file/openDocument.ts
packages/uni-h5/src/service/api/file/openDocument.ts
+2
-2
packages/uni-h5/src/service/api/index.ts
packages/uni-h5/src/service/api/index.ts
+0
-2
packages/uni-h5/src/service/api/media/getImageInfo.ts
packages/uni-h5/src/service/api/media/getImageInfo.ts
+2
-2
packages/uni-h5/src/service/api/route/navigateBack.ts
packages/uni-h5/src/service/api/route/navigateBack.ts
+2
-2
packages/uni-h5/src/service/api/route/navigateTo.ts
packages/uni-h5/src/service/api/route/navigateTo.ts
+2
-2
packages/uni-h5/src/service/api/route/reLaunch.ts
packages/uni-h5/src/service/api/route/reLaunch.ts
+2
-2
packages/uni-h5/src/service/api/route/redirectTo.ts
packages/uni-h5/src/service/api/route/redirectTo.ts
+2
-2
packages/uni-h5/src/service/api/route/switchTab.ts
packages/uni-h5/src/service/api/route/switchTab.ts
+2
-2
packages/uni-h5/src/service/api/util/getRealPath.ts
packages/uni-h5/src/service/api/util/getRealPath.ts
+0
-5
packages/uni-mp-alipay/dist/uni.api.esm.js
packages/uni-mp-alipay/dist/uni.api.esm.js
+6
-6
packages/uni-mp-alipay/src/platform/index.ts
packages/uni-mp-alipay/src/platform/index.ts
+2
-0
packages/uni-mp-baidu/dist/uni.api.esm.js
packages/uni-mp-baidu/dist/uni.api.esm.js
+6
-6
packages/uni-mp-baidu/src/platform/index.ts
packages/uni-mp-baidu/src/platform/index.ts
+1
-0
packages/uni-mp-qq/dist/uni.api.esm.js
packages/uni-mp-qq/dist/uni.api.esm.js
+6
-6
packages/uni-mp-qq/src/platform/index.ts
packages/uni-mp-qq/src/platform/index.ts
+1
-0
packages/uni-mp-toutiao/dist/uni.api.esm.js
packages/uni-mp-toutiao/dist/uni.api.esm.js
+6
-6
packages/uni-mp-toutiao/src/platform/index.ts
packages/uni-mp-toutiao/src/platform/index.ts
+1
-0
packages/uni-mp-weixin/dist/uni.api.esm.js
packages/uni-mp-weixin/dist/uni.api.esm.js
+6
-6
packages/uni-mp-weixin/src/platform/index.ts
packages/uni-mp-weixin/src/platform/index.ts
+1
-0
packages/uni-quickapp-webview/dist/uni.api.esm.js
packages/uni-quickapp-webview/dist/uni.api.esm.js
+6
-6
packages/uni-quickapp-webview/src/platform/index.ts
packages/uni-quickapp-webview/src/platform/index.ts
+1
-0
未找到文件。
packages/uni-api/src/helpers/api/index.ts
浏览文件 @
84634920
...
@@ -63,12 +63,12 @@ function wrapperApi<T extends Function>(
...
@@ -63,12 +63,12 @@ function wrapperApi<T extends Function>(
}
as
unknown
)
as
T
}
as
unknown
)
as
T
}
}
export
function
creat
eOnApi
<
T
extends
Function
>
(
export
function
defin
eOnApi
<
T
extends
Function
>
(
name
:
string
,
name
:
string
,
fn
:
T
,
fn
:
T
,
options
?:
ApiOptions
options
?:
ApiOptions
)
{
)
{
return
creat
eApi
(
return
defin
eApi
(
API_TYPE_ON
,
API_TYPE_ON
,
name
,
name
,
fn
,
fn
,
...
@@ -77,13 +77,13 @@ export function createOnApi<T extends Function>(
...
@@ -77,13 +77,13 @@ export function createOnApi<T extends Function>(
)
)
}
}
export
function
creat
eTaskApi
<
T
extends
Function
>
(
export
function
defin
eTaskApi
<
T
extends
Function
>
(
name
:
string
,
name
:
string
,
fn
:
T
,
fn
:
T
,
protocol
?:
ApiProtocols
,
protocol
?:
ApiProtocols
,
options
?:
ApiOptions
options
?:
ApiOptions
)
{
)
{
return
creat
eApi
(
return
defin
eApi
(
API_TYPE_TASK
,
API_TYPE_TASK
,
name
,
name
,
fn
,
fn
,
...
@@ -92,13 +92,13 @@ export function createTaskApi<T extends Function>(
...
@@ -92,13 +92,13 @@ export function createTaskApi<T extends Function>(
)
)
}
}
export
function
creat
eSyncApi
<
T
extends
Function
>
(
export
function
defin
eSyncApi
<
T
extends
Function
>
(
name
:
string
,
name
:
string
,
fn
:
T
,
fn
:
T
,
protocol
?:
ApiProtocols
,
protocol
?:
ApiProtocols
,
options
?:
ApiOptions
options
?:
ApiOptions
)
{
)
{
return
creat
eApi
(
return
defin
eApi
(
API_TYPE_SYNC
,
API_TYPE_SYNC
,
name
,
name
,
fn
,
fn
,
...
@@ -107,18 +107,18 @@ export function createSyncApi<T extends Function>(
...
@@ -107,18 +107,18 @@ export function createSyncApi<T extends Function>(
)
)
}
}
export
function
creat
eAsyncApi
<
T
extends
Function
>
(
export
function
defin
eAsyncApi
<
T
extends
Function
>
(
name
:
string
,
name
:
string
,
fn
:
T
,
fn
:
T
,
protocol
?:
ApiProtocols
,
protocol
?:
ApiProtocols
,
options
?:
ApiOptions
options
?:
ApiOptions
)
{
)
{
return
promisify
(
return
promisify
(
creat
eApi
(
API_TYPE_ASYNC
,
name
,
fn
,
__DEV__
?
protocol
:
undefined
,
options
)
defin
eApi
(
API_TYPE_ASYNC
,
name
,
fn
,
__DEV__
?
protocol
:
undefined
,
options
)
)
)
}
}
function
creat
eApi
<
T
extends
Function
>
(
function
defin
eApi
<
T
extends
Function
>
(
type
:
API_TYPES
,
type
:
API_TYPES
,
name
:
string
,
name
:
string
,
fn
:
T
,
fn
:
T
,
...
...
packages/uni-api/src/index.ts
浏览文件 @
84634920
...
@@ -23,10 +23,10 @@ export * from './protocols/media/getImageInfo'
...
@@ -23,10 +23,10 @@ export * from './protocols/media/getImageInfo'
// helpers
// helpers
export
{
export
{
creat
eOnApi
,
defin
eOnApi
,
creat
eTaskApi
,
defin
eTaskApi
,
creat
eSyncApi
,
defin
eSyncApi
,
creat
eAsyncApi
,
defin
eAsyncApi
,
}
from
'
./helpers/api
'
}
from
'
./helpers/api
'
export
{
handlePromise
}
from
'
./helpers/api/promise
'
export
{
handlePromise
}
from
'
./helpers/api/promise
'
...
...
packages/uni-api/src/protocols/media/getImageInfo.ts
浏览文件 @
84634920
import
{
getRealPath
}
from
'
@dcloudio/uni-platform
'
import
{
ApiOptions
,
ApiProtocol
}
from
'
../type
'
import
{
ApiOptions
,
ApiProtocol
}
from
'
../type
'
export
const
GetImageInfoOptions
:
ApiOptions
=
{
export
const
GetImageInfoOptions
:
ApiOptions
=
{
formatArgs
:
{
formatArgs
:
{
src
(
src
,
params
)
{
src
(
src
,
params
)
{
params
.
src
=
(
uni
as
any
).
getRealPath
(
src
)
params
.
src
=
getRealPath
(
src
)
},
},
},
},
}
}
...
...
packages/uni-api/src/service/base/base64.ts
浏览文件 @
84634920
// @ts-ignore
// @ts-ignore
import
{
encode
,
decode
}
from
'
../../helpers/base64-arraybuffer
'
import
{
encode
,
decode
}
from
'
../../helpers/base64-arraybuffer
'
import
{
creat
eSyncApi
}
from
'
../../helpers/api
'
import
{
defin
eSyncApi
}
from
'
../../helpers/api
'
import
{
import
{
Base64ToArrayBufferProtocol
,
Base64ToArrayBufferProtocol
,
ArrayBufferToBase64Protocol
,
ArrayBufferToBase64Protocol
,
}
from
'
../../protocols/base/base64
'
}
from
'
../../protocols/base/base64
'
export
const
base64ToArrayBuffer
=
creat
eSyncApi
<
export
const
base64ToArrayBuffer
=
defin
eSyncApi
<
typeof
uni
.
base64ToArrayBuffer
typeof
uni
.
base64ToArrayBuffer
>
(
>
(
'
base64ToArrayBuffer
'
,
'
base64ToArrayBuffer
'
,
...
@@ -18,7 +18,7 @@ export const base64ToArrayBuffer = createSyncApi<
...
@@ -18,7 +18,7 @@ export const base64ToArrayBuffer = createSyncApi<
Base64ToArrayBufferProtocol
Base64ToArrayBufferProtocol
)
)
export
const
arrayBufferToBase64
=
creat
eSyncApi
<
export
const
arrayBufferToBase64
=
defin
eSyncApi
<
typeof
uni
.
arrayBufferToBase64
typeof
uni
.
arrayBufferToBase64
>
(
>
(
'
arrayBufferToBase64
'
,
'
arrayBufferToBase64
'
,
...
...
packages/uni-api/src/service/base/interceptor.ts
浏览文件 @
84634920
...
@@ -8,7 +8,7 @@ import {
...
@@ -8,7 +8,7 @@ import {
HOOKS
,
HOOKS
,
}
from
'
../../helpers/interceptor
'
}
from
'
../../helpers/interceptor
'
import
{
creat
eSyncApi
}
from
'
../../helpers/api
'
import
{
defin
eSyncApi
}
from
'
../../helpers/api
'
import
{
import
{
AddInterceptorProtocol
,
AddInterceptorProtocol
,
...
@@ -80,7 +80,7 @@ function removeHook(hooks: Function[] | undefined, hook: Function) {
...
@@ -80,7 +80,7 @@ function removeHook(hooks: Function[] | undefined, hook: Function) {
}
}
}
}
export
const
addInterceptor
=
creat
eSyncApi
(
export
const
addInterceptor
=
defin
eSyncApi
(
'
addInterceptor
'
,
'
addInterceptor
'
,
(
method
:
string
|
Interceptor
,
interceptor
:
Interceptor
|
undefined
)
=>
{
(
method
:
string
|
Interceptor
,
interceptor
:
Interceptor
|
undefined
)
=>
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
...
@@ -95,7 +95,7 @@ export const addInterceptor = createSyncApi(
...
@@ -95,7 +95,7 @@ export const addInterceptor = createSyncApi(
AddInterceptorProtocol
AddInterceptorProtocol
)
)
export
const
removeInterceptor
=
creat
eSyncApi
(
export
const
removeInterceptor
=
defin
eSyncApi
(
'
removeInterceptor
'
,
'
removeInterceptor
'
,
(
method
:
string
|
Interceptor
,
interceptor
:
Interceptor
|
undefined
)
=>
{
(
method
:
string
|
Interceptor
,
interceptor
:
Interceptor
|
undefined
)
=>
{
if
(
typeof
method
===
'
string
'
)
{
if
(
typeof
method
===
'
string
'
)
{
...
...
packages/uni-api/src/service/base/upx2px.ts
浏览文件 @
84634920
import
{
getBaseSystemInfo
}
from
'
@dcloudio/uni-platform
'
import
{
getBaseSystemInfo
}
from
'
@dcloudio/uni-platform
'
import
{
creat
eSyncApi
}
from
'
../../helpers/api
'
import
{
defin
eSyncApi
}
from
'
../../helpers/api
'
import
{
Upx2pxProtocol
}
from
'
../../protocols/base/upx2px
'
import
{
Upx2pxProtocol
}
from
'
../../protocols/base/upx2px
'
const
EPS
=
1
e
-
4
const
EPS
=
1
e
-
4
...
@@ -15,7 +15,7 @@ function checkDeviceWidth() {
...
@@ -15,7 +15,7 @@ function checkDeviceWidth() {
isIOS
=
platform
===
'
ios
'
isIOS
=
platform
===
'
ios
'
}
}
export
const
upx2px
=
creat
eSyncApi
<
typeof
uni
.
upx2px
>
(
export
const
upx2px
=
defin
eSyncApi
<
typeof
uni
.
upx2px
>
(
'
upx2px
'
,
'
upx2px
'
,
(
number
,
newDeviceWidth
?:
number
)
=>
{
(
number
,
newDeviceWidth
?:
number
)
=>
{
if
(
deviceWidth
===
0
)
{
if
(
deviceWidth
===
0
)
{
...
...
packages/uni-api/src/service/ui/createIntersectionObserver.ts
浏览文件 @
84634920
...
@@ -2,7 +2,7 @@ import { extend } from '@vue/shared'
...
@@ -2,7 +2,7 @@ import { extend } from '@vue/shared'
import
{
ServiceJSBridge
}
from
'
@dcloudio/uni-core
'
import
{
ServiceJSBridge
}
from
'
@dcloudio/uni-core
'
import
{
creat
eSyncApi
}
from
'
../../helpers/api
'
import
{
defin
eSyncApi
}
from
'
../../helpers/api
'
import
{
getCurrentPageVm
}
from
'
../utils
'
import
{
getCurrentPageVm
}
from
'
../utils
'
const
defaultOptions
=
{
const
defaultOptions
=
{
...
@@ -120,7 +120,7 @@ class ServiceIntersectionObserver {
...
@@ -120,7 +120,7 @@ class ServiceIntersectionObserver {
}
}
}
}
export
const
createIntersectionObserver
=
creat
eSyncApi
<
export
const
createIntersectionObserver
=
defin
eSyncApi
<
typeof
uni
.
createIntersectionObserver
typeof
uni
.
createIntersectionObserver
>
(
'
createIntersectionObserver
'
,
(
context
?,
options
?)
=>
{
>
(
'
createIntersectionObserver
'
,
(
context
?,
options
?)
=>
{
if
(
!
context
)
{
if
(
!
context
)
{
...
...
packages/uni-h5/dist/uni-h5.esm.js
浏览文件 @
84634920
...
@@ -3319,7 +3319,7 @@ function addBase(filePath) {
...
@@ -3319,7 +3319,7 @@ function addBase(filePath) {
}
}
return
base
+
filePath
;
return
base
+
filePath
;
}
}
function
getRealPath
$1
(
filePath
)
{
function
getRealPath
(
filePath
)
{
if
(
__uniConfig
.
router
.
base
===
"
./
"
)
{
if
(
__uniConfig
.
router
.
base
===
"
./
"
)
{
filePath
=
filePath
.
replace
(
/^
\.\/
static
\/
/
,
"
/static/
"
);
filePath
=
filePath
.
replace
(
/^
\.\/
static
\/
/
,
"
/static/
"
);
}
}
...
@@ -3395,7 +3395,7 @@ const _sfc_main$j = {
...
@@ -3395,7 +3395,7 @@ const _sfc_main$j = {
return
this
.
originalWidth
&&
this
.
originalHeight
?
this
.
originalWidth
/
this
.
originalHeight
:
0
;
return
this
.
originalWidth
&&
this
.
originalHeight
?
this
.
originalWidth
/
this
.
originalHeight
:
0
;
},
},
realImagePath
()
{
realImagePath
()
{
return
getRealPath
$1
(
this
.
src
);
return
getRealPath
(
this
.
src
);
},
},
modeStyle
()
{
modeStyle
()
{
let
size
=
"
auto
"
;
let
size
=
"
auto
"
;
...
@@ -7716,13 +7716,13 @@ function wrapperApi(fn, name, protocol, options) {
...
@@ -7716,13 +7716,13 @@ function wrapperApi(fn, name, protocol, options) {
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
};
};
}
}
function
creat
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
function
defin
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
return
creat
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
process
.
env
.
NODE_ENV
!==
"
production
"
?
protocol
:
void
0
,
options
);
return
defin
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
process
.
env
.
NODE_ENV
!==
"
production
"
?
protocol
:
void
0
,
options
);
}
}
function
creat
eAsyncApi
(
name
,
fn
,
protocol
,
options
)
{
function
defin
eAsyncApi
(
name
,
fn
,
protocol
,
options
)
{
return
promisify
(
creat
eApi
(
API_TYPE_ASYNC
,
name
,
fn
,
process
.
env
.
NODE_ENV
!==
"
production
"
?
protocol
:
void
0
,
options
));
return
promisify
(
defin
eApi
(
API_TYPE_ASYNC
,
name
,
fn
,
process
.
env
.
NODE_ENV
!==
"
production
"
?
protocol
:
void
0
,
options
));
}
}
function
creat
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
function
defin
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
switch
(
type
)
{
switch
(
type
)
{
case
API_TYPE_ON
:
case
API_TYPE_ON
:
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
...
@@ -7748,10 +7748,10 @@ const ArrayBufferToBase64Protocol = [
...
@@ -7748,10 +7748,10 @@ const ArrayBufferToBase64Protocol = [
required
:
true
required
:
true
}
}
];
];
const
base64ToArrayBuffer
=
/* @__PURE__ */
creat
eSyncApi
(
"
base64ToArrayBuffer
"
,
(
base64
)
=>
{
const
base64ToArrayBuffer
=
defin
eSyncApi
(
"
base64ToArrayBuffer
"
,
(
base64
)
=>
{
return
decode
(
base64
);
return
decode
(
base64
);
},
Base64ToArrayBufferProtocol
);
},
Base64ToArrayBufferProtocol
);
const
arrayBufferToBase64
=
/* @__PURE__ */
creat
eSyncApi
(
"
arrayBufferToBase64
"
,
(
arrayBuffer
)
=>
{
const
arrayBufferToBase64
=
defin
eSyncApi
(
"
arrayBufferToBase64
"
,
(
arrayBuffer
)
=>
{
return
encode
(
arrayBuffer
);
return
encode
(
arrayBuffer
);
},
ArrayBufferToBase64Protocol
);
},
ArrayBufferToBase64Protocol
);
const
Upx2pxProtocol
=
[
const
Upx2pxProtocol
=
[
...
@@ -7772,7 +7772,7 @@ function checkDeviceWidth() {
...
@@ -7772,7 +7772,7 @@ function checkDeviceWidth() {
deviceDPR
=
pixelRatio2
;
deviceDPR
=
pixelRatio2
;
isIOS
=
platform
===
"
ios
"
;
isIOS
=
platform
===
"
ios
"
;
}
}
const
upx2px
=
/* @__PURE__ */
creat
eSyncApi
(
"
upx2px
"
,
(
number
,
newDeviceWidth
)
=>
{
const
upx2px
=
defin
eSyncApi
(
"
upx2px
"
,
(
number
,
newDeviceWidth
)
=>
{
if
(
deviceWidth
===
0
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
();
checkDeviceWidth
();
}
}
...
@@ -7851,14 +7851,14 @@ function removeHook(hooks, hook) {
...
@@ -7851,14 +7851,14 @@ function removeHook(hooks, hook) {
hooks
.
splice
(
index2
,
1
);
hooks
.
splice
(
index2
,
1
);
}
}
}
}
const
addInterceptor
=
/* @__PURE__ */
creat
eSyncApi
(
"
addInterceptor
"
,
(
method
,
interceptor
)
=>
{
const
addInterceptor
=
defin
eSyncApi
(
"
addInterceptor
"
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
"
string
"
&&
isPlainObject
(
interceptor
))
{
if
(
typeof
method
===
"
string
"
&&
isPlainObject
(
interceptor
))
{
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
}
else
if
(
isPlainObject
(
method
))
{
}
else
if
(
isPlainObject
(
method
))
{
mergeInterceptorHook
(
globalInterceptors
,
method
);
mergeInterceptorHook
(
globalInterceptors
,
method
);
}
}
},
AddInterceptorProtocol
);
},
AddInterceptorProtocol
);
const
removeInterceptor
=
/* @__PURE__ */
creat
eSyncApi
(
"
removeInterceptor
"
,
(
method
,
interceptor
)
=>
{
const
removeInterceptor
=
defin
eSyncApi
(
"
removeInterceptor
"
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
"
string
"
)
{
if
(
typeof
method
===
"
string
"
)
{
if
(
isPlainObject
(
interceptor
))
{
if
(
isPlainObject
(
interceptor
))
{
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
...
@@ -7946,7 +7946,7 @@ class ServiceIntersectionObserver {
...
@@ -7946,7 +7946,7 @@ class ServiceIntersectionObserver {
},
this
.
_pageId
);
},
this
.
_pageId
);
}
}
}
}
const
createIntersectionObserver
=
/* @__PURE__ */
creat
eSyncApi
(
"
createIntersectionObserver
"
,
(
context
,
options
)
=>
{
const
createIntersectionObserver
=
defin
eSyncApi
(
"
createIntersectionObserver
"
,
(
context
,
options
)
=>
{
if
(
!
context
)
{
if
(
!
context
)
{
context
=
getCurrentPageVm
();
context
=
getCurrentPageVm
();
}
}
...
@@ -7984,7 +7984,7 @@ const OpenDocumentProtocol = {
...
@@ -7984,7 +7984,7 @@ const OpenDocumentProtocol = {
const
GetImageInfoOptions
=
{
const
GetImageInfoOptions
=
{
formatArgs
:
{
formatArgs
:
{
src
(
src
,
params
)
{
src
(
src
,
params
)
{
params
.
src
=
uni
.
getRealPath
(
src
);
params
.
src
=
getRealPath
(
src
);
}
}
}
}
};
};
...
@@ -8002,16 +8002,16 @@ const SCHEMA_CSS = {
...
@@ -8002,16 +8002,16 @@ const SCHEMA_CSS = {
"
css.env
"
:
cssSupports
(
"
top:env(a)
"
),
"
css.env
"
:
cssSupports
(
"
top:env(a)
"
),
"
css.constant
"
:
cssSupports
(
"
top:constant(a)
"
)
"
css.constant
"
:
cssSupports
(
"
top:constant(a)
"
)
};
};
const
canIUse
=
/* @__PURE__ */
creat
eSyncApi
(
"
canIUse
"
,
(
schema
)
=>
{
const
canIUse
=
defin
eSyncApi
(
"
canIUse
"
,
(
schema
)
=>
{
if
(
hasOwn$1
(
SCHEMA_CSS
,
schema
))
{
if
(
hasOwn$1
(
SCHEMA_CSS
,
schema
))
{
return
SCHEMA_CSS
[
schema
];
return
SCHEMA_CSS
[
schema
];
}
}
return
true
;
return
true
;
},
CanIUseProtocol
);
},
CanIUseProtocol
);
const
makePhoneCall
=
/* @__PURE__ */
creat
eAsyncApi
(
"
makePhoneCall
"
,
(
option
)
=>
{
const
makePhoneCall
=
defin
eAsyncApi
(
"
makePhoneCall
"
,
(
option
)
=>
{
window
.
location
.
href
=
`tel:
${
option
.
phoneNumber
}
`
;
window
.
location
.
href
=
`tel:
${
option
.
phoneNumber
}
`
;
},
MakePhoneCallProtocol
);
},
MakePhoneCallProtocol
);
const
getSystemInfoSync
=
/* @__PURE__ */
creat
eSyncApi
(
"
getSystemInfoSync
"
,
()
=>
{
const
getSystemInfoSync
=
defin
eSyncApi
(
"
getSystemInfoSync
"
,
()
=>
{
const
pixelRatio2
=
window
.
devicePixelRatio
;
const
pixelRatio2
=
window
.
devicePixelRatio
;
const
screenFix
=
getScreenFix
();
const
screenFix
=
getScreenFix
();
const
landscape
=
isLandscape
(
screenFix
);
const
landscape
=
isLandscape
(
screenFix
);
...
@@ -8111,16 +8111,16 @@ const getSystemInfoSync = /* @__PURE__ */ createSyncApi("getSystemInfoSync", ()
...
@@ -8111,16 +8111,16 @@ const getSystemInfoSync = /* @__PURE__ */ createSyncApi("getSystemInfoSync", ()
}
}
};
};
});
});
const
getSystemInfo
=
/* @__PURE__ */
creat
eAsyncApi
(
"
getSystemInfo
"
,
()
=>
{
const
getSystemInfo
=
defin
eAsyncApi
(
"
getSystemInfo
"
,
()
=>
{
return
getSystemInfoSync
();
return
getSystemInfoSync
();
});
});
const
openDocument
=
/* @__PURE__ */
creat
eAsyncApi
(
"
openDocument
"
,
(
option
)
=>
{
const
openDocument
=
defin
eAsyncApi
(
"
openDocument
"
,
(
option
)
=>
{
window
.
open
(
option
.
filePath
);
window
.
open
(
option
.
filePath
);
},
OpenDocumentProtocol
);
},
OpenDocumentProtocol
);
function
_getServiceAddress
()
{
function
_getServiceAddress
()
{
return
window
.
location
.
protocol
+
"
//
"
+
window
.
location
.
host
;
return
window
.
location
.
protocol
+
"
//
"
+
window
.
location
.
host
;
}
}
const
getImageInfo
=
/* @__PURE__ */
creat
eAsyncApi
(
"
getImageInfo
"
,
({
src
},
callback
)
=>
{
const
getImageInfo
=
defin
eAsyncApi
(
"
getImageInfo
"
,
({
src
},
callback
)
=>
{
const
img
=
new
Image
();
const
img
=
new
Image
();
img
.
onload
=
function
()
{
img
.
onload
=
function
()
{
callback
({
callback
({
...
@@ -8137,9 +8137,9 @@ const getImageInfo = /* @__PURE__ */ createAsyncApi("getImageInfo", ({src}, call
...
@@ -8137,9 +8137,9 @@ const getImageInfo = /* @__PURE__ */ createAsyncApi("getImageInfo", ({src}, call
};
};
img
.
src
=
src
;
img
.
src
=
src
;
},
GetImageInfoProtocol
,
GetImageInfoOptions
);
},
GetImageInfoProtocol
,
GetImageInfoOptions
);
const
navigateBack
=
/* @__PURE__ */
creat
eAsyncApi
(
"
navigateBack
"
,
()
=>
{
const
navigateBack
=
defin
eAsyncApi
(
"
navigateBack
"
,
()
=>
{
});
});
const
navigateTo
=
/* @__PURE__ */
creat
eAsyncApi
(
"
navigateTo
"
,
(
options
)
=>
{
const
navigateTo
=
defin
eAsyncApi
(
"
navigateTo
"
,
(
options
)
=>
{
const
router
=
getApp
().
$router
;
const
router
=
getApp
().
$router
;
router
.
push
({
router
.
push
({
path
:
options
.
url
,
path
:
options
.
url
,
...
@@ -8147,14 +8147,11 @@ const navigateTo = /* @__PURE__ */ createAsyncApi("navigateTo", (options) => {
...
@@ -8147,14 +8147,11 @@ const navigateTo = /* @__PURE__ */ createAsyncApi("navigateTo", (options) => {
state
:
createPageState
(
"
navigateTo
"
)
state
:
createPageState
(
"
navigateTo
"
)
});
});
});
});
const
redirectTo
=
/* @__PURE__ */
creat
eAsyncApi
(
"
redirectTo
"
,
()
=>
{
const
redirectTo
=
defin
eAsyncApi
(
"
redirectTo
"
,
()
=>
{
});
});
const
reLaunch
=
/* @__PURE__ */
creat
eAsyncApi
(
"
reLaunch
"
,
()
=>
{
const
reLaunch
=
defin
eAsyncApi
(
"
reLaunch
"
,
()
=>
{
});
});
const
switchTab
=
/* @__PURE__ */
createAsyncApi
(
"
switchTab
"
,
()
=>
{
const
switchTab
=
defineAsyncApi
(
"
switchTab
"
,
()
=>
{
});
const
getRealPath
=
/* @__PURE__ */
createSyncApi
(
"
getRealPath
"
,
(
path
)
=>
{
return
path
;
});
});
var
api
=
/* @__PURE__ */
Object
.
freeze
({
var
api
=
/* @__PURE__ */
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
...
@@ -8177,8 +8174,7 @@ var api = /* @__PURE__ */ Object.freeze({
...
@@ -8177,8 +8174,7 @@ var api = /* @__PURE__ */ Object.freeze({
navigateTo
,
navigateTo
,
redirectTo
,
redirectTo
,
reLaunch
,
reLaunch
,
switchTab
,
switchTab
getRealPath
});
});
const
uni$1
=
api
;
const
uni$1
=
api
;
const
UniServiceJSBridge$1
=
extend
(
ServiceJSBridge
,
{
const
UniServiceJSBridge$1
=
extend
(
ServiceJSBridge
,
{
...
@@ -8464,7 +8460,7 @@ function usePageHeadButtons(navigationBar) {
...
@@ -8464,7 +8460,7 @@ function usePageHeadButtons(navigationBar) {
const
fonts
=
Object
.
create
(
null
);
const
fonts
=
Object
.
create
(
null
);
buttons
.
forEach
((
btn
)
=>
{
buttons
.
forEach
((
btn
)
=>
{
if
(
btn
.
fontSrc
&&
!
btn
.
fontFamily
)
{
if
(
btn
.
fontSrc
&&
!
btn
.
fontFamily
)
{
const
fontSrc
=
getRealPath
$1
(
btn
.
fontSrc
);
const
fontSrc
=
getRealPath
(
btn
.
fontSrc
);
let
fontFamily
=
fonts
[
fontSrc
];
let
fontFamily
=
fonts
[
fontSrc
];
if
(
!
fontFamily
)
{
if
(
!
fontFamily
)
{
fontFamily
=
`font
${
Date
.
now
()}
`
;
fontFamily
=
`font
${
Date
.
now
()}
`
;
...
@@ -9268,4 +9264,4 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
...
@@ -9268,4 +9264,4 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
]);
]);
}
}
_sfc_main
.
render
=
_sfc_render
;
_sfc_main
.
render
=
_sfc_render
;
export
{
_sfc_main$1
as
AsyncErrorComponent
,
_sfc_main
as
AsyncLoadingComponent
,
_sfc_main$p
as
Audio
,
_sfc_main$o
as
Canvas
,
_sfc_main$n
as
Checkbox
,
_sfc_main$m
as
CheckboxGroup
,
_sfc_main$l
as
Editor
,
_sfc_main$k
as
Form
,
index$1
as
Icon
,
_sfc_main$j
as
Image
,
_sfc_main$i
as
Input
,
_sfc_main$h
as
Label
,
_sfc_main$g
as
MovableView
,
_sfc_main$f
as
Navigator
,
index
as
PageComponent
,
_sfc_main$e
as
Progress
,
_sfc_main$d
as
Radio
,
_sfc_main$c
as
RadioGroup
,
_sfc_main$b
as
ResizeSensor
,
_sfc_main$a
as
RichText
,
_sfc_main$9
as
ScrollView
,
_sfc_main$8
as
Slider
,
_sfc_main$7
as
SwiperItem
,
_sfc_main$6
as
Switch
,
_sfc_main$5
as
Text
,
_sfc_main$4
as
Textarea
,
UniServiceJSBridge$1
as
UniServiceJSBridge
,
UniViewJSBridge$1
as
UniViewJSBridge
,
_sfc_main$3
as
View
,
addInterceptor
,
arrayBufferToBase64
,
base64ToArrayBuffer
,
canIUse
,
createIntersectionObserver
,
createSelectorQuery
,
getApp$1
as
getApp
,
getCurrentPages$1
as
getCurrentPages
,
getImageInfo
,
get
RealPath
,
get
SystemInfo
,
getSystemInfoSync
,
makePhoneCall
,
navigateBack
,
navigateTo
,
openDocument
,
index$2
as
plugin
,
promiseInterceptor
,
reLaunch
,
redirectTo
,
removeInterceptor
,
switchTab
,
uni$1
as
uni
,
upx2px
};
export
{
_sfc_main$1
as
AsyncErrorComponent
,
_sfc_main
as
AsyncLoadingComponent
,
_sfc_main$p
as
Audio
,
_sfc_main$o
as
Canvas
,
_sfc_main$n
as
Checkbox
,
_sfc_main$m
as
CheckboxGroup
,
_sfc_main$l
as
Editor
,
_sfc_main$k
as
Form
,
index$1
as
Icon
,
_sfc_main$j
as
Image
,
_sfc_main$i
as
Input
,
_sfc_main$h
as
Label
,
_sfc_main$g
as
MovableView
,
_sfc_main$f
as
Navigator
,
index
as
PageComponent
,
_sfc_main$e
as
Progress
,
_sfc_main$d
as
Radio
,
_sfc_main$c
as
RadioGroup
,
_sfc_main$b
as
ResizeSensor
,
_sfc_main$a
as
RichText
,
_sfc_main$9
as
ScrollView
,
_sfc_main$8
as
Slider
,
_sfc_main$7
as
SwiperItem
,
_sfc_main$6
as
Switch
,
_sfc_main$5
as
Text
,
_sfc_main$4
as
Textarea
,
UniServiceJSBridge$1
as
UniServiceJSBridge
,
UniViewJSBridge$1
as
UniViewJSBridge
,
_sfc_main$3
as
View
,
addInterceptor
,
arrayBufferToBase64
,
base64ToArrayBuffer
,
canIUse
,
createIntersectionObserver
,
createSelectorQuery
,
getApp$1
as
getApp
,
getCurrentPages$1
as
getCurrentPages
,
getImageInfo
,
getSystemInfo
,
getSystemInfoSync
,
makePhoneCall
,
navigateBack
,
navigateTo
,
openDocument
,
index$2
as
plugin
,
promiseInterceptor
,
reLaunch
,
redirectTo
,
removeInterceptor
,
switchTab
,
uni$1
as
uni
,
upx2px
};
packages/uni-h5/src/service/api/base/canIUse.ts
浏览文件 @
84634920
import
{
hasOwn
}
from
'
@vue/shared
'
import
{
hasOwn
}
from
'
@vue/shared
'
import
{
CanIUseProtocol
,
creat
eSyncApi
}
from
'
@dcloudio/uni-api
'
import
{
CanIUseProtocol
,
defin
eSyncApi
}
from
'
@dcloudio/uni-api
'
function
cssSupports
(
css
:
string
)
{
function
cssSupports
(
css
:
string
)
{
return
window
.
CSS
&&
window
.
CSS
.
supports
&&
window
.
CSS
.
supports
(
css
)
return
window
.
CSS
&&
window
.
CSS
.
supports
&&
window
.
CSS
.
supports
(
css
)
...
@@ -12,7 +12,7 @@ const SCHEMA_CSS = {
...
@@ -12,7 +12,7 @@ const SCHEMA_CSS = {
'
css.constant
'
:
cssSupports
(
'
top:constant(a)
'
),
'
css.constant
'
:
cssSupports
(
'
top:constant(a)
'
),
}
}
export
const
canIUse
=
creat
eSyncApi
<
typeof
uni
.
canIUse
>
(
export
const
canIUse
=
defin
eSyncApi
<
typeof
uni
.
canIUse
>
(
'
canIUse
'
,
'
canIUse
'
,
(
schema
:
string
)
=>
{
(
schema
:
string
)
=>
{
if
(
hasOwn
(
SCHEMA_CSS
,
schema
))
{
if
(
hasOwn
(
SCHEMA_CSS
,
schema
))
{
...
...
packages/uni-h5/src/service/api/device/getSystemInfo.ts
浏览文件 @
84634920
import
{
creat
eAsyncApi
}
from
'
@dcloudio/uni-api
'
import
{
defin
eAsyncApi
}
from
'
@dcloudio/uni-api
'
import
{
getSystemInfoSync
}
from
'
./getSystemInfoSync
'
import
{
getSystemInfoSync
}
from
'
./getSystemInfoSync
'
export
const
getSystemInfo
=
creat
eAsyncApi
<
typeof
uni
.
getSystemInfo
>
(
export
const
getSystemInfo
=
defin
eAsyncApi
<
typeof
uni
.
getSystemInfo
>
(
'
getSystemInfo
'
,
'
getSystemInfo
'
,
()
=>
{
()
=>
{
return
getSystemInfoSync
()
return
getSystemInfoSync
()
...
...
packages/uni-h5/src/service/api/device/getSystemInfoSync.ts
浏览文件 @
84634920
import
safeAreaInsets
from
'
safe-area-insets
'
import
safeAreaInsets
from
'
safe-area-insets
'
import
{
creat
eSyncApi
}
from
'
@dcloudio/uni-api
'
import
{
defin
eSyncApi
}
from
'
@dcloudio/uni-api
'
import
{
getWindowOffset
}
from
'
@dcloudio/uni-core
'
import
{
getWindowOffset
}
from
'
@dcloudio/uni-core
'
...
@@ -18,7 +18,7 @@ import {
...
@@ -18,7 +18,7 @@ import {
/**
/**
* 获取系统信息-同步
* 获取系统信息-同步
*/
*/
export
const
getSystemInfoSync
=
creat
eSyncApi
<
typeof
uni
.
getSystemInfoSync
>
(
export
const
getSystemInfoSync
=
defin
eSyncApi
<
typeof
uni
.
getSystemInfoSync
>
(
'
getSystemInfoSync
'
,
'
getSystemInfoSync
'
,
()
=>
{
()
=>
{
const
pixelRatio
=
window
.
devicePixelRatio
const
pixelRatio
=
window
.
devicePixelRatio
...
...
packages/uni-h5/src/service/api/device/makePhoneCall.ts
浏览文件 @
84634920
import
{
creat
eAsyncApi
,
MakePhoneCallProtocol
}
from
'
@dcloudio/uni-api
'
import
{
defin
eAsyncApi
,
MakePhoneCallProtocol
}
from
'
@dcloudio/uni-api
'
export
const
makePhoneCall
=
creat
eAsyncApi
<
typeof
uni
.
makePhoneCall
>
(
export
const
makePhoneCall
=
defin
eAsyncApi
<
typeof
uni
.
makePhoneCall
>
(
'
makePhoneCall
'
,
'
makePhoneCall
'
,
(
option
)
=>
{
(
option
)
=>
{
window
.
location
.
href
=
`tel:
${
option
.
phoneNumber
}
`
window
.
location
.
href
=
`tel:
${
option
.
phoneNumber
}
`
...
...
packages/uni-h5/src/service/api/file/openDocument.ts
浏览文件 @
84634920
import
{
creat
eAsyncApi
,
OpenDocumentProtocol
}
from
'
@dcloudio/uni-api
'
import
{
defin
eAsyncApi
,
OpenDocumentProtocol
}
from
'
@dcloudio/uni-api
'
export
const
openDocument
=
creat
eAsyncApi
<
typeof
uni
.
openDocument
>
(
export
const
openDocument
=
defin
eAsyncApi
<
typeof
uni
.
openDocument
>
(
'
openDocument
'
,
'
openDocument
'
,
(
option
)
=>
{
(
option
)
=>
{
window
.
open
(
option
.
filePath
)
window
.
open
(
option
.
filePath
)
...
...
packages/uni-h5/src/service/api/index.ts
浏览文件 @
84634920
...
@@ -14,8 +14,6 @@ export * from './route/redirectTo'
...
@@ -14,8 +14,6 @@ export * from './route/redirectTo'
export
*
from
'
./route/reLaunch
'
export
*
from
'
./route/reLaunch
'
export
*
from
'
./route/switchTab
'
export
*
from
'
./route/switchTab
'
export
*
from
'
./util/getRealPath
'
export
{
export
{
upx2px
,
upx2px
,
addInterceptor
,
addInterceptor
,
...
...
packages/uni-h5/src/service/api/media/getImageInfo.ts
浏览文件 @
84634920
import
{
import
{
creat
eAsyncApi
,
defin
eAsyncApi
,
GetImageInfoOptions
,
GetImageInfoOptions
,
GetImageInfoProtocol
,
GetImageInfoProtocol
,
}
from
'
@dcloudio/uni-api
'
}
from
'
@dcloudio/uni-api
'
...
@@ -8,7 +8,7 @@ function _getServiceAddress() {
...
@@ -8,7 +8,7 @@ function _getServiceAddress() {
return
window
.
location
.
protocol
+
'
//
'
+
window
.
location
.
host
return
window
.
location
.
protocol
+
'
//
'
+
window
.
location
.
host
}
}
export
const
getImageInfo
=
creat
eAsyncApi
<
typeof
uni
.
getImageInfo
>
(
export
const
getImageInfo
=
defin
eAsyncApi
<
typeof
uni
.
getImageInfo
>
(
'
getImageInfo
'
,
'
getImageInfo
'
,
({
src
},
callback
?:
Function
)
=>
{
({
src
},
callback
?:
Function
)
=>
{
const
img
=
new
Image
()
const
img
=
new
Image
()
...
...
packages/uni-h5/src/service/api/route/navigateBack.ts
浏览文件 @
84634920
import
{
creat
eAsyncApi
}
from
'
@dcloudio/uni-api
'
import
{
defin
eAsyncApi
}
from
'
@dcloudio/uni-api
'
export
const
navigateBack
=
creat
eAsyncApi
<
typeof
uni
.
navigateBack
>
(
export
const
navigateBack
=
defin
eAsyncApi
<
typeof
uni
.
navigateBack
>
(
'
navigateBack
'
,
'
navigateBack
'
,
()
=>
{}
()
=>
{}
)
)
packages/uni-h5/src/service/api/route/navigateTo.ts
浏览文件 @
84634920
import
{
Router
}
from
'
vue-router
'
import
{
Router
}
from
'
vue-router
'
import
{
creat
eAsyncApi
}
from
'
@dcloudio/uni-api
'
import
{
defin
eAsyncApi
}
from
'
@dcloudio/uni-api
'
import
{
createPageState
}
from
'
../../../framework/plugin/page
'
import
{
createPageState
}
from
'
../../../framework/plugin/page
'
export
const
navigateTo
=
creat
eAsyncApi
<
typeof
uni
.
navigateTo
>
(
export
const
navigateTo
=
defin
eAsyncApi
<
typeof
uni
.
navigateTo
>
(
'
navigateTo
'
,
'
navigateTo
'
,
(
options
)
=>
{
(
options
)
=>
{
const
router
=
getApp
().
$router
as
Router
const
router
=
getApp
().
$router
as
Router
...
...
packages/uni-h5/src/service/api/route/reLaunch.ts
浏览文件 @
84634920
import
{
creat
eAsyncApi
}
from
'
@dcloudio/uni-api
'
import
{
defin
eAsyncApi
}
from
'
@dcloudio/uni-api
'
export
const
reLaunch
=
creat
eAsyncApi
(
'
reLaunch
'
,
()
=>
{})
export
const
reLaunch
=
defin
eAsyncApi
(
'
reLaunch
'
,
()
=>
{})
packages/uni-h5/src/service/api/route/redirectTo.ts
浏览文件 @
84634920
import
{
creat
eAsyncApi
}
from
'
@dcloudio/uni-api
'
import
{
defin
eAsyncApi
}
from
'
@dcloudio/uni-api
'
export
const
redirectTo
=
creat
eAsyncApi
(
'
redirectTo
'
,
()
=>
{})
export
const
redirectTo
=
defin
eAsyncApi
(
'
redirectTo
'
,
()
=>
{})
packages/uni-h5/src/service/api/route/switchTab.ts
浏览文件 @
84634920
import
{
creat
eAsyncApi
}
from
'
@dcloudio/uni-api
'
import
{
defin
eAsyncApi
}
from
'
@dcloudio/uni-api
'
export
const
switchTab
=
creat
eAsyncApi
(
'
switchTab
'
,
()
=>
{})
export
const
switchTab
=
defin
eAsyncApi
(
'
switchTab
'
,
()
=>
{})
packages/uni-h5/src/service/api/util/getRealPath.ts
已删除
100644 → 0
浏览文件 @
9151b16f
import
{
createSyncApi
}
from
'
@dcloudio/uni-api
'
export
const
getRealPath
=
createSyncApi
(
'
getRealPath
'
,
(
path
:
string
)
=>
{
return
path
})
packages/uni-mp-alipay/dist/uni.api.esm.js
浏览文件 @
84634920
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
};
};
}
}
function
creat
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
function
defin
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
return
creat
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
return
defin
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
}
function
creat
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
function
defin
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
switch
(
type
)
{
switch
(
type
)
{
case
API_TYPE_ON
:
case
API_TYPE_ON
:
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
deviceDPR
=
pixelRatio
;
deviceDPR
=
pixelRatio
;
isIOS
=
platform
===
'
ios
'
;
isIOS
=
platform
===
'
ios
'
;
}
}
const
upx2px
=
creat
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
const
upx2px
=
defin
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
if
(
deviceWidth
===
0
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
();
checkDeviceWidth
();
}
}
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
hooks
.
splice
(
index
,
1
);
hooks
.
splice
(
index
,
1
);
}
}
}
}
const
addInterceptor
=
creat
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
addInterceptor
=
defin
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
}
}
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
mergeInterceptorHook
(
globalInterceptors
,
method
);
mergeInterceptorHook
(
globalInterceptors
,
method
);
}
}
},
AddInterceptorProtocol
);
},
AddInterceptorProtocol
);
const
removeInterceptor
=
creat
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
removeInterceptor
=
defin
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
)
{
if
(
typeof
method
===
'
string
'
)
{
if
(
isPlainObject
(
interceptor
))
{
if
(
isPlainObject
(
interceptor
))
{
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
...
...
packages/uni-mp-alipay/src/platform/index.ts
浏览文件 @
84634920
export
function
getBaseSystemInfo
()
{
export
function
getBaseSystemInfo
()
{
return
my
.
getSystemInfoSync
()
return
my
.
getSystemInfoSync
()
}
}
export
function
getRealPath
()
{}
packages/uni-mp-baidu/dist/uni.api.esm.js
浏览文件 @
84634920
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
};
};
}
}
function
creat
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
function
defin
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
return
creat
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
return
defin
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
}
function
creat
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
function
defin
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
switch
(
type
)
{
switch
(
type
)
{
case
API_TYPE_ON
:
case
API_TYPE_ON
:
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
deviceDPR
=
pixelRatio
;
deviceDPR
=
pixelRatio
;
isIOS
=
platform
===
'
ios
'
;
isIOS
=
platform
===
'
ios
'
;
}
}
const
upx2px
=
creat
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
const
upx2px
=
defin
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
if
(
deviceWidth
===
0
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
();
checkDeviceWidth
();
}
}
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
hooks
.
splice
(
index
,
1
);
hooks
.
splice
(
index
,
1
);
}
}
}
}
const
addInterceptor
=
creat
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
addInterceptor
=
defin
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
}
}
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
mergeInterceptorHook
(
globalInterceptors
,
method
);
mergeInterceptorHook
(
globalInterceptors
,
method
);
}
}
},
AddInterceptorProtocol
);
},
AddInterceptorProtocol
);
const
removeInterceptor
=
creat
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
removeInterceptor
=
defin
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
)
{
if
(
typeof
method
===
'
string
'
)
{
if
(
isPlainObject
(
interceptor
))
{
if
(
isPlainObject
(
interceptor
))
{
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
...
...
packages/uni-mp-baidu/src/platform/index.ts
浏览文件 @
84634920
export
function
getBaseSystemInfo
()
{
export
function
getBaseSystemInfo
()
{
return
swan
.
getSystemInfoSync
()
return
swan
.
getSystemInfoSync
()
}
}
export
function
getRealPath
()
{}
packages/uni-mp-qq/dist/uni.api.esm.js
浏览文件 @
84634920
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
};
};
}
}
function
creat
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
function
defin
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
return
creat
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
return
defin
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
}
function
creat
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
function
defin
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
switch
(
type
)
{
switch
(
type
)
{
case
API_TYPE_ON
:
case
API_TYPE_ON
:
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
deviceDPR
=
pixelRatio
;
deviceDPR
=
pixelRatio
;
isIOS
=
platform
===
'
ios
'
;
isIOS
=
platform
===
'
ios
'
;
}
}
const
upx2px
=
creat
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
const
upx2px
=
defin
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
if
(
deviceWidth
===
0
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
();
checkDeviceWidth
();
}
}
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
hooks
.
splice
(
index
,
1
);
hooks
.
splice
(
index
,
1
);
}
}
}
}
const
addInterceptor
=
creat
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
addInterceptor
=
defin
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
}
}
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
mergeInterceptorHook
(
globalInterceptors
,
method
);
mergeInterceptorHook
(
globalInterceptors
,
method
);
}
}
},
AddInterceptorProtocol
);
},
AddInterceptorProtocol
);
const
removeInterceptor
=
creat
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
removeInterceptor
=
defin
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
)
{
if
(
typeof
method
===
'
string
'
)
{
if
(
isPlainObject
(
interceptor
))
{
if
(
isPlainObject
(
interceptor
))
{
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
...
...
packages/uni-mp-qq/src/platform/index.ts
浏览文件 @
84634920
export
function
getBaseSystemInfo
()
{
export
function
getBaseSystemInfo
()
{
return
qq
.
getSystemInfoSync
()
return
qq
.
getSystemInfoSync
()
}
}
export
function
getRealPath
()
{}
packages/uni-mp-toutiao/dist/uni.api.esm.js
浏览文件 @
84634920
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
};
};
}
}
function
creat
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
function
defin
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
return
creat
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
return
defin
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
}
function
creat
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
function
defin
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
switch
(
type
)
{
switch
(
type
)
{
case
API_TYPE_ON
:
case
API_TYPE_ON
:
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
deviceDPR
=
pixelRatio
;
deviceDPR
=
pixelRatio
;
isIOS
=
platform
===
'
ios
'
;
isIOS
=
platform
===
'
ios
'
;
}
}
const
upx2px
=
creat
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
const
upx2px
=
defin
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
if
(
deviceWidth
===
0
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
();
checkDeviceWidth
();
}
}
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
hooks
.
splice
(
index
,
1
);
hooks
.
splice
(
index
,
1
);
}
}
}
}
const
addInterceptor
=
creat
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
addInterceptor
=
defin
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
}
}
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
mergeInterceptorHook
(
globalInterceptors
,
method
);
mergeInterceptorHook
(
globalInterceptors
,
method
);
}
}
},
AddInterceptorProtocol
);
},
AddInterceptorProtocol
);
const
removeInterceptor
=
creat
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
removeInterceptor
=
defin
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
)
{
if
(
typeof
method
===
'
string
'
)
{
if
(
isPlainObject
(
interceptor
))
{
if
(
isPlainObject
(
interceptor
))
{
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
...
...
packages/uni-mp-toutiao/src/platform/index.ts
浏览文件 @
84634920
export
function
getBaseSystemInfo
()
{
export
function
getBaseSystemInfo
()
{
return
tt
.
getSystemInfoSync
()
return
tt
.
getSystemInfoSync
()
}
}
export
function
getRealPath
()
{}
packages/uni-mp-weixin/dist/uni.api.esm.js
浏览文件 @
84634920
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
};
};
}
}
function
creat
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
function
defin
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
return
creat
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
return
defin
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
}
function
creat
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
function
defin
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
switch
(
type
)
{
switch
(
type
)
{
case
API_TYPE_ON
:
case
API_TYPE_ON
:
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
deviceDPR
=
pixelRatio
;
deviceDPR
=
pixelRatio
;
isIOS
=
platform
===
'
ios
'
;
isIOS
=
platform
===
'
ios
'
;
}
}
const
upx2px
=
creat
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
const
upx2px
=
defin
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
if
(
deviceWidth
===
0
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
();
checkDeviceWidth
();
}
}
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
hooks
.
splice
(
index
,
1
);
hooks
.
splice
(
index
,
1
);
}
}
}
}
const
addInterceptor
=
creat
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
addInterceptor
=
defin
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
}
}
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
mergeInterceptorHook
(
globalInterceptors
,
method
);
mergeInterceptorHook
(
globalInterceptors
,
method
);
}
}
},
AddInterceptorProtocol
);
},
AddInterceptorProtocol
);
const
removeInterceptor
=
creat
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
removeInterceptor
=
defin
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
)
{
if
(
typeof
method
===
'
string
'
)
{
if
(
isPlainObject
(
interceptor
))
{
if
(
isPlainObject
(
interceptor
))
{
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
...
...
packages/uni-mp-weixin/src/platform/index.ts
浏览文件 @
84634920
export
function
getBaseSystemInfo
()
{
export
function
getBaseSystemInfo
()
{
return
wx
.
getSystemInfoSync
()
return
wx
.
getSystemInfoSync
()
}
}
export
function
getRealPath
()
{}
packages/uni-quickapp-webview/dist/uni.api.esm.js
浏览文件 @
84634920
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
...
@@ -285,10 +285,10 @@ function wrapperApi(fn, name, protocol, options) {
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
return
fn
.
apply
(
null
,
formatApiArgs
(
args
));
};
};
}
}
function
creat
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
function
defin
eSyncApi
(
name
,
fn
,
protocol
,
options
)
{
return
creat
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
return
defin
eApi
(
API_TYPE_SYNC
,
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
}
function
creat
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
function
defin
eApi
(
type
,
name
,
fn
,
protocol
,
options
)
{
switch
(
type
)
{
switch
(
type
)
{
case
API_TYPE_ON
:
case
API_TYPE_ON
:
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
return
wrapperApi
(
wrapperOnApi
(
name
,
fn
),
name
,
protocol
);
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
...
@@ -324,7 +324,7 @@ function checkDeviceWidth() {
deviceDPR
=
pixelRatio
;
deviceDPR
=
pixelRatio
;
isIOS
=
platform
===
'
ios
'
;
isIOS
=
platform
===
'
ios
'
;
}
}
const
upx2px
=
creat
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
const
upx2px
=
defin
eSyncApi
(
'
upx2px
'
,
(
number
,
newDeviceWidth
)
=>
{
if
(
deviceWidth
===
0
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
();
checkDeviceWidth
();
}
}
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
...
@@ -506,7 +506,7 @@ function removeHook(hooks, hook) {
hooks
.
splice
(
index
,
1
);
hooks
.
splice
(
index
,
1
);
}
}
}
}
const
addInterceptor
=
creat
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
addInterceptor
=
defin
eSyncApi
(
'
addInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
if
(
typeof
method
===
'
string
'
&&
isPlainObject
(
interceptor
))
{
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
mergeInterceptorHook
(
scopedInterceptors
[
method
]
||
(
scopedInterceptors
[
method
]
=
{}),
interceptor
);
}
}
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
...
@@ -514,7 +514,7 @@ const addInterceptor = createSyncApi('addInterceptor', (method, interceptor) =>
mergeInterceptorHook
(
globalInterceptors
,
method
);
mergeInterceptorHook
(
globalInterceptors
,
method
);
}
}
},
AddInterceptorProtocol
);
},
AddInterceptorProtocol
);
const
removeInterceptor
=
creat
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
const
removeInterceptor
=
defin
eSyncApi
(
'
removeInterceptor
'
,
(
method
,
interceptor
)
=>
{
if
(
typeof
method
===
'
string
'
)
{
if
(
typeof
method
===
'
string
'
)
{
if
(
isPlainObject
(
interceptor
))
{
if
(
isPlainObject
(
interceptor
))
{
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
removeInterceptorHook
(
scopedInterceptors
[
method
],
interceptor
);
...
...
packages/uni-quickapp-webview/src/platform/index.ts
浏览文件 @
84634920
export
function
getBaseSystemInfo
()
{
export
function
getBaseSystemInfo
()
{
return
qa
.
getSystemInfoSync
()
return
qa
.
getSystemInfoSync
()
}
}
export
function
getRealPath
()
{}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录