Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
touchx
uni-app
提交
1b2a8059
U
uni-app
项目概览
touchx
/
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,发现更多精彩内容 >>
提交
1b2a8059
编写于
11月 21, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
4dcf0ef2
c7c8d577
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
88 addition
and
29 deletion
+88
-29
packages/uni-app/dist/uts.js
packages/uni-app/dist/uts.js
+35
-13
packages/uni-app/src/uts.ts
packages/uni-app/src/uts.ts
+46
-10
packages/uni-cli-shared/lib/uts/utils.js
packages/uni-cli-shared/lib/uts/utils.js
+1
-0
packages/uni-cli-shared/lib/uts/uts.js
packages/uni-cli-shared/lib/uts/uts.js
+4
-4
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-1
src/platforms/app-plus/service/api/device/soter-authentication.js
...forms/app-plus/service/api/device/soter-authentication.js
+1
-1
未找到文件。
packages/uni-app/dist/uts.js
浏览文件 @
1b2a8059
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
})
;
exports
.
__esModule
=
true
;
exports
.
initUtsClassName
=
exports
.
initUtsIndexClassName
=
exports
.
initUtsPackageName
=
exports
.
initUtsProxyClass
=
exports
.
initUtsProxyFunction
=
exports
.
normalizeArg
=
void
0
;
var
utils_1
=
require
(
"
./utils
"
);
var
callbackId
=
1
;
...
...
@@ -7,7 +7,9 @@ var proxy;
var
callbacks
=
{};
function
normalizeArg
(
arg
)
{
if
(
typeof
arg
===
'
function
'
)
{
var
id
=
callbackId
++
;
// 查找该函数是否已缓存
var
oldId
=
Object
.
keys
(
callbacks
).
find
(
function
(
id
)
{
return
callbacks
[
id
]
===
arg
;
});
var
id
=
oldId
?
parseInt
(
oldId
)
:
callbackId
++
;
callbacks
[
id
]
=
arg
;
return
id
;
}
...
...
@@ -36,10 +38,14 @@ function resolveSyncResult(res) {
return
res
.
params
;
}
function
invokePropGetter
(
args
)
{
if
(
args
.
errMsg
)
{
throw
new
Error
(
args
.
errMsg
);
}
delete
args
.
errMsg
;
return
resolveSyncResult
(
getProxy
().
invokeSync
(
args
,
function
()
{
}));
}
function
initProxyFunction
(
async
,
_a
,
instanceId
)
{
var
pkg
=
_a
.
package
,
cls
=
_a
.
class
,
propOrMethod
=
_a
.
name
,
method
=
_a
.
method
,
companion
=
_a
.
companion
,
methodParams
=
_a
.
params
;
var
pkg
=
_a
.
package
,
cls
=
_a
[
"
class
"
],
propOrMethod
=
_a
.
name
,
method
=
_a
.
method
,
companion
=
_a
.
companion
,
methodParams
=
_a
.
params
,
errMsg
=
_a
.
errMsg
;
var
invokeCallback
=
function
(
_a
)
{
var
id
=
_a
.
id
,
name
=
_a
.
name
,
params
=
_a
.
params
,
keepAlive
=
_a
.
keepAlive
;
var
callback
=
callbacks
[
id
];
...
...
@@ -57,18 +63,21 @@ function initProxyFunction(async, _a, instanceId) {
?
{
id
:
instanceId
,
name
:
propOrMethod
,
method
:
methodParams
}
:
{
package
:
pkg
,
class
:
cls
,
"
class
"
:
cls
,
name
:
method
||
propOrMethod
,
companion
:
companion
,
method
:
methodParams
,
method
:
methodParams
};
return
function
()
{
var
args
=
[];
for
(
var
_i
=
0
;
_i
<
arguments
.
length
;
_i
++
)
{
args
[
_i
]
=
arguments
[
_i
];
}
if
(
errMsg
)
{
throw
new
Error
(
errMsg
);
}
var
invokeArgs
=
(
0
,
utils_1
.
extend
)({},
baseArgs
,
{
params
:
args
.
map
(
function
(
arg
)
{
return
normalizeArg
(
arg
);
})
,
params
:
args
.
map
(
function
(
arg
)
{
return
normalizeArg
(
arg
);
})
});
if
(
async
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
...
...
@@ -100,18 +109,23 @@ function initUtsStaticMethod(async, opts) {
}
exports
.
initUtsProxyFunction
=
initUtsStaticMethod
;
function
initUtsProxyClass
(
_a
)
{
var
pkg
=
_a
.
package
,
cls
=
_a
.
class
,
constructorParams
=
_a
.
constructor
.
params
,
methods
=
_a
.
methods
,
props
=
_a
.
props
,
staticProps
=
_a
.
staticProps
,
staticMethods
=
_a
.
staticMethods
;
var
pkg
=
_a
.
package
,
cls
=
_a
[
"
class
"
],
constructorParams
=
_a
.
constructor
.
params
,
methods
=
_a
.
methods
,
props
=
_a
.
props
,
staticProps
=
_a
.
staticProps
,
staticMethods
=
_a
.
staticMethods
,
errMsg
=
_a
.
errMsg
;
var
baseOptions
=
{
package
:
pkg
,
class
:
cls
,
"
class
"
:
cls
,
errMsg
:
errMsg
};
var
ProxyClass
=
(
function
()
{
var
ProxyClass
=
/** @class */
(
function
()
{
function
UtsClass
()
{
var
params
=
[];
for
(
var
_i
=
0
;
_i
<
arguments
.
length
;
_i
++
)
{
params
[
_i
]
=
arguments
[
_i
];
}
if
(
errMsg
)
{
throw
new
Error
(
errMsg
);
}
var
target
=
{};
// 初始化实例 ID
var
instanceId
=
initProxyFunction
(
false
,
(
0
,
utils_1
.
extend
)({
name
:
'
constructor
'
,
params
:
constructorParams
},
baseOptions
),
0
).
apply
(
null
,
params
);
if
(
!
instanceId
)
{
throw
new
Error
(
"
new
"
.
concat
(
cls
,
"
is failed
"
));
...
...
@@ -119,19 +133,25 @@ function initUtsProxyClass(_a) {
return
new
Proxy
(
this
,
{
get
:
function
(
_
,
name
)
{
if
(
!
target
[
name
])
{
//实例方法
if
((
0
,
utils_1
.
hasOwn
)(
methods
,
name
))
{
var
_a
=
methods
[
name
],
async
=
_a
.
async
,
params_1
=
_a
.
params
;
target
[
name
]
=
initUtsInstanceMethod
(
!!
async
,
(
0
,
utils_1
.
extend
)({
name
:
name
,
params
:
params_1
,
params
:
params_1
},
baseOptions
),
instanceId
);
}
else
if
(
props
.
includes
(
name
))
{
return
invokePropGetter
({
id
:
instanceId
,
name
:
name
});
// 实例属性
return
invokePropGetter
({
id
:
instanceId
,
name
:
name
,
errMsg
:
errMsg
});
}
}
return
target
[
name
];
}
,
}
});
}
return
UtsClass
;
...
...
@@ -142,15 +162,17 @@ function initUtsProxyClass(_a) {
if
((
0
,
utils_1
.
hasOwn
)(
staticMethods
,
name
))
{
if
(
!
staticMethodCache
[
name
])
{
var
_a
=
staticMethods
[
name
],
async
=
_a
.
async
,
params
=
_a
.
params
;
// 静态方法
staticMethodCache
[
name
]
=
initUtsStaticMethod
(
!!
async
,
(
0
,
utils_1
.
extend
)({
name
:
name
,
companion
:
true
,
params
:
params
},
baseOptions
));
}
return
staticMethodCache
[
name
];
}
if
(
staticProps
.
includes
(
name
))
{
// 静态属性
return
invokePropGetter
((
0
,
utils_1
.
extend
)({
name
:
name
,
companion
:
true
},
baseOptions
));
}
return
Reflect
.
get
(
target
,
name
,
receiver
);
}
,
}
});
}
exports
.
initUtsProxyClass
=
initUtsProxyClass
;
...
...
packages/uni-app/src/uts.ts
浏览文件 @
1b2a8059
...
...
@@ -4,14 +4,17 @@ declare const plus: any
let
callbackId
=
1
let
proxy
:
any
const
callbacks
:
Record
<
string
,
Function
>
=
{}
export
function
normalizeArg
(
arg
:
unknown
)
{
if
(
typeof
arg
===
'
function
'
)
{
const
id
=
callbackId
++
// 查找该函数是否已缓存
const
oldId
=
Object
.
keys
(
callbacks
).
find
((
id
)
=>
callbacks
[
id
]
===
arg
)
const
id
=
oldId
?
parseInt
(
oldId
)
:
callbackId
++
callbacks
[
id
]
=
arg
return
id
}
else
if
(
isPlainObject
(
arg
))
{
Object
.
keys
(
arg
).
forEach
((
name
)
=>
{
;
(
arg
as
any
)[
name
]
=
normalizeArg
((
arg
as
any
)[
name
])
;(
arg
as
any
)[
name
]
=
normalizeArg
((
arg
as
any
)[
name
])
})
}
return
arg
...
...
@@ -58,6 +61,10 @@ interface ProxyFunctionOptions {
* 方法参数列表
*/
params
:
Parameter
[]
/**
* 运行时提示的错误信息
*/
errMsg
?:
string
}
interface
ProxyClassOptions
{
...
...
@@ -80,6 +87,10 @@ interface ProxyClassOptions {
params
:
Parameter
[]
}
}
/**
* 运行时提示的错误信息
*/
errMsg
?:
string
}
interface
InvokeInstanceArgs
{
...
...
@@ -87,6 +98,10 @@ interface InvokeInstanceArgs {
name
:
string
params
?:
unknown
[]
method
?:
Parameter
[]
/**
* 运行时提示的错误信息
*/
errMsg
?:
string
}
interface
InvokeStaticArgs
{
/**
...
...
@@ -113,6 +128,10 @@ interface InvokeStaticArgs {
* 是否是伴生对象
*/
companion
?:
boolean
/**
* 运行时提示的错误信息
*/
errMsg
?:
string
}
type
InvokeArgs
=
InvokeInstanceArgs
|
InvokeStaticArgs
...
...
@@ -156,7 +175,11 @@ function resolveSyncResult(res: InvokeSyncRes) {
}
function
invokePropGetter
(
args
:
InvokeArgs
)
{
return
resolveSyncResult
(
getProxy
().
invokeSync
(
args
,
()
=>
{
}))
if
(
args
.
errMsg
)
{
throw
new
Error
(
args
.
errMsg
)
}
delete
args
.
errMsg
return
resolveSyncResult
(
getProxy
().
invokeSync
(
args
,
()
=>
{}))
}
function
initProxyFunction
(
...
...
@@ -168,6 +191,7 @@ function initProxyFunction(
method
,
companion
,
params
:
methodParams
,
errMsg
,
}:
ProxyFunctionOptions
,
instanceId
:
number
)
{
...
...
@@ -190,13 +214,16 @@ function initProxyFunction(
const
baseArgs
:
InvokeArgs
=
instanceId
?
{
id
:
instanceId
,
name
:
propOrMethod
,
method
:
methodParams
}
:
{
package
:
pkg
,
class
:
cls
,
name
:
method
||
propOrMethod
,
companion
,
method
:
methodParams
,
}
package
:
pkg
,
class
:
cls
,
name
:
method
||
propOrMethod
,
companion
,
method
:
methodParams
,
}
return
(...
args
:
unknown
[])
=>
{
if
(
errMsg
)
{
throw
new
Error
(
errMsg
)
}
const
invokeArgs
=
extend
({},
baseArgs
,
{
params
:
args
.
map
((
arg
)
=>
normalizeArg
(
arg
)),
})
...
...
@@ -238,13 +265,18 @@ export function initUtsProxyClass({
props
,
staticProps
,
staticMethods
,
errMsg
,
}:
ProxyClassOptions
):
any
{
const
baseOptions
=
{
package
:
pkg
,
class
:
cls
,
errMsg
,
}
const
ProxyClass
=
class
UtsClass
{
constructor
(...
params
:
unknown
[])
{
if
(
errMsg
)
{
throw
new
Error
(
errMsg
)
}
const
target
:
Record
<
string
,
Function
>
=
{}
// 初始化实例 ID
const
instanceId
=
initProxyFunction
(
...
...
@@ -274,7 +306,11 @@ export function initUtsProxyClass({
)
}
else
if
(
props
.
includes
(
name
as
string
))
{
// 实例属性
return
invokePropGetter
({
id
:
instanceId
,
name
:
name
as
string
})
return
invokePropGetter
({
id
:
instanceId
,
name
:
name
as
string
,
errMsg
,
})
}
}
return
target
[
name
as
string
]
...
...
packages/uni-cli-shared/lib/uts/utils.js
浏览文件 @
1b2a8059
...
...
@@ -32,6 +32,7 @@ Please run \`${command}\` and try again.`
}
module
.
exports
=
{
version
:
require
(
'
../../package.json
'
).
version
,
normalizePath
,
installDepTips
}
packages/uni-cli-shared/lib/uts/uts.js
浏览文件 @
1b2a8059
...
...
@@ -88,11 +88,11 @@ function resolveUTSCompiler() {
});
}
catch
(
e
)
{
let
version
=
require
(
'
@dcloudio/uni-cli-shared/package.json
'
)
.
version
;
if
(
version
.
startsWith
(
'
2.0.
'
))
{
v
ersion
=
'
^3.0.0-alpha-3060920221117001
'
;
let
utsCompilerVersion
=
utils_1
.
version
;
if
(
utils_1
.
version
.
startsWith
(
'
2.0.
'
))
{
utsCompilerV
ersion
=
'
^3.0.0-alpha-3060920221117001
'
;
}
console
.
error
((
0
,
utils_1
.
installDepTips
)(
'
devDependencies
'
,
'
@dcloudio/uni-uts-v1
'
,
v
ersion
));
console
.
error
((
0
,
utils_1
.
installDepTips
)(
'
devDependencies
'
,
'
@dcloudio/uni-uts-v1
'
,
utsCompilerV
ersion
));
process
.
exit
(
0
);
}
}
...
...
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
1b2a8059
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
src/platforms/app-plus/service/api/device/soter-authentication.js
浏览文件 @
1b2a8059
...
...
@@ -96,7 +96,7 @@ export function startSoterAuthentication ({
return
{
authMode
:
supportMode
[
0
]
||
'
fingerPrint
'
,
errCode
:
90001
,
errMsg
:
'
startSoterAuthentication:fail
'
errMsg
:
'
startSoterAuthentication:fail
not support
'
}
}
const
supportRequestAuthMode
=
[]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录