Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
79a43be0
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
79a43be0
编写于
6月 09, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(core): onError
上级
307ecfb4
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
52 addition
and
48 deletion
+52
-48
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+3
-3
packages/uni-app-plus/dist/uni.runtime.esm.js
packages/uni-app-plus/dist/uni.runtime.esm.js
+12
-12
packages/uni-app-plus/dist/uni.vue.js
packages/uni-app-plus/dist/uni.vue.js
+15
-13
packages/uni-mp-core/src/index.ts
packages/uni-mp-core/src/index.ts
+1
-1
packages/uni-vue/src/appConfig.ts
packages/uni-vue/src/appConfig.ts
+19
-17
packages/uni-vue/src/index.ts
packages/uni-vue/src/index.ts
+2
-2
未找到文件。
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
79a43be0
此差异已折叠。
点击以展开。
packages/uni-app-plus/dist/uni.runtime.esm.js
浏览文件 @
79a43be0
...
...
@@ -13374,7 +13374,7 @@ function weexGetSystemInfoSync() {
}
const getDeviceInfo = defineSyncApi('getDeviceInfo', () => {
weexGetSystemInfoSync();
const { deviceBrand, deviceModel, osName, osVersion, deviceOrientation, deviceType, } = systemInfo;
const { deviceBrand
= ''
, deviceModel, osName, osVersion, deviceOrientation, deviceType, } = systemInfo;
const brand = deviceBrand.toLowerCase();
const _osName = osName.toLowerCase();
return {
...
...
@@ -14069,17 +14069,17 @@ const getImageInfo = defineAsyncApi(API_GET_IMAGE_INFO, (options, { resolve, rej
const getVideoInfo = defineAsyncApi(API_GET_VIDEO_INFO, (options, { resolve, reject }) => {
plus.io.getVideoInfo({
filePath: options.src,
success: (
data
) => {
re
turn
{
orientation:
data
.orientation,
type:
data
.type,
duration:
data
.duration,
size:
data
.size,
height:
data
.height,
width:
data
.width,
fps:
data
.fps || 30,
bitrate:
data
.bitrate,
};
success: (
videoInfo
) => {
re
solve(
{
orientation:
videoInfo
.orientation,
type:
videoInfo
.type,
duration:
videoInfo
.duration,
size:
videoInfo
.size,
height:
videoInfo
.height,
width:
videoInfo
.width,
fps:
videoInfo
.fps || 30,
bitrate:
videoInfo
.bitrate,
}
)
;
},
fail: warpPlusErrorCallback(reject),
});
...
...
packages/uni-app-plus/dist/uni.vue.js
浏览文件 @
79a43be0
import
{
isString
,
isArray
,
isFunction
}
from
'
@vue/shared
'
;
import
{
invokeArrayFns
,
ON_LOAD
,
ON_SHOW
,
LINEFEED
,
RENDERJS_MODULES
,
WXS_PROTOCOL
,
formatLog
,
WXS_MODULES
,
UniLifecycleHooks
,
ON_ERROR
,
invokeCreateVueAppHook
}
from
'
@dcloudio/uni-shared
'
;
import
{
invokeArrayFns
,
ON_LOAD
,
ON_SHOW
,
LINEFEED
,
RENDERJS_MODULES
,
WXS_PROTOCOL
,
formatLog
,
WXS_MODULES
,
ON_ERROR
,
UniLifecycleHooks
,
invokeCreateVueAppHook
}
from
'
@dcloudio/uni-shared
'
;
import
{
injectHook
}
from
'
vue
'
;
function
getCurrentPage
()
{
...
...
@@ -148,17 +148,19 @@ function set(target, key, val) {
return
(
target
[
key
]
=
val
);
}
function
errorHandler
(
err
,
instance
,
info
)
{
if
(
!
instance
)
{
throw
err
;
}
const
app
=
getApp
();
if
(
!
app
||
!
app
.
$vm
)
{
throw
err
;
}
{
invokeHook
(
app
.
$vm
,
ON_ERROR
,
err
);
}
function
createErrorHandler
(
app
)
{
return
function
errorHandler
(
err
,
instance
,
_info
)
{
if
(
!
instance
)
{
throw
err
;
}
const
appInstance
=
app
.
_instance
;
if
(
!
appInstance
||
!
appInstance
.
proxy
)
{
throw
err
;
}
{
invokeHook
(
appInstance
.
proxy
.
$vm
,
ON_ERROR
,
err
);
}
};
}
function
mergeAsArray
(
to
,
from
)
{
return
to
?
[...
new
Set
([].
concat
(
to
,
from
))]
:
from
;
...
...
@@ -254,7 +256,7 @@ function uniIdMixin(globalProperties) {
function
initApp
(
app
)
{
const
appConfig
=
app
.
_context
.
config
;
if
(
isFunction
(
app
.
_component
.
onError
))
{
appConfig
.
errorHandler
=
errorHandler
;
appConfig
.
errorHandler
=
createErrorHandler
(
app
)
;
}
initOptionMergeStrategies
(
appConfig
.
optionMergeStrategies
);
const
globalProperties
=
appConfig
.
globalProperties
;
...
...
packages/uni-mp-core/src/index.ts
浏览文件 @
79a43be0
...
...
@@ -2,7 +2,7 @@ declare module '@vue/runtime-core' {
interface
ComponentCustomProperties
{
$vm
:
ComponentPublicInstance
globalData
:
Record
<
string
,
any
>
$callHook
:
(
hook
:
string
,
args
?:
unknown
)
=>
unknown
$callHook
:
(
hook
:
string
,
args
?:
unknown
,
extras
?:
unknown
)
=>
unknown
$callCreatedHook
:
()
=>
void
}
}
...
...
packages/uni-vue/src/appConfig.ts
浏览文件 @
79a43be0
import
{
invokeHook
}
from
'
@dcloudio/uni-core
'
import
{
ON_ERROR
,
UniLifecycleHooks
}
from
'
@dcloudio/uni-shared
'
import
{
AppConfig
,
ComponentPublicInstance
}
from
'
vue
'
import
{
App
,
App
Config
,
ComponentPublicInstance
}
from
'
vue
'
export
function
errorHandler
(
err
:
unknown
,
instance
:
ComponentPublicInstance
|
null
,
info
:
string
)
{
if
(
!
instance
)
{
throw
err
}
const
app
=
getApp
()
if
(
!
app
||
!
app
.
$vm
)
{
throw
err
}
if
(
__PLATFORM__
!==
'
h5
'
&&
__PLATFORM__
!==
'
app
'
)
{
app
.
$vm
.
$callHook
(
ON_ERROR
,
err
,
info
)
}
else
{
invokeHook
(
app
.
$vm
,
ON_ERROR
,
err
)
export
function
createErrorHandler
(
app
:
App
)
{
return
function
errorHandler
(
err
:
unknown
,
instance
:
ComponentPublicInstance
|
null
,
_info
:
string
)
{
if
(
!
instance
)
{
throw
err
}
const
appInstance
=
app
.
_instance
if
(
!
appInstance
||
!
appInstance
.
proxy
)
{
throw
err
}
if
(
__PLATFORM__
!==
'
h5
'
&&
__PLATFORM__
!==
'
app
'
)
{
appInstance
.
proxy
.
$vm
.
$callHook
(
ON_ERROR
,
err
)
}
else
{
invokeHook
(
appInstance
.
proxy
.
$vm
,
ON_ERROR
,
err
)
}
}
}
...
...
packages/uni-vue/src/index.ts
浏览文件 @
79a43be0
...
...
@@ -5,13 +5,13 @@ import { invokeCreateVueAppHook } from '@dcloudio/uni-shared'
import
{
applyOptions
}
from
'
./componentOptions
'
import
{
set
}
from
'
./componentInstance
'
import
{
e
rrorHandler
,
initOptionMergeStrategies
}
from
'
./appConfig
'
import
{
createE
rrorHandler
,
initOptionMergeStrategies
}
from
'
./appConfig
'
import
{
uniIdMixin
}
from
'
./uni-id-mixin
'
export
function
initApp
(
app
:
App
)
{
const
appConfig
=
app
.
_context
.
config
if
(
isFunction
((
app
.
_component
as
any
).
onError
))
{
appConfig
.
errorHandler
=
errorHandler
appConfig
.
errorHandler
=
createErrorHandler
(
app
)
}
initOptionMergeStrategies
(
appConfig
.
optionMergeStrategies
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录