收口H5原生能力门控
H5 原生导航和支付能力统一通过 canUseNativeHostCapability 门控 原生壳门禁禁止 H5 facade 直接读取宿主能力数组 架构文档记录 H5 原生能力统一门控规则
This commit is contained in:
@@ -505,7 +505,7 @@ export async function navigateHostNativePage(
|
||||
) {
|
||||
const runtime = getHostRuntime();
|
||||
if (runtime.kind === 'native_app') {
|
||||
if (!runtime.hostCapabilities.includes('navigation.openNativePage')) {
|
||||
if (!canUseNativeHostCapability('navigation.openNativePage')) {
|
||||
return false;
|
||||
}
|
||||
const result = await requestNativeHostBoolean(
|
||||
@@ -551,7 +551,7 @@ export async function requestHostPayment({
|
||||
}: HostPaymentRequest) {
|
||||
const runtime = getHostRuntime();
|
||||
if (runtime.kind === 'native_app') {
|
||||
if (!runtime.hostCapabilities.includes('payment.request')) {
|
||||
if (!canUseNativeHostCapability('payment.request')) {
|
||||
return false;
|
||||
}
|
||||
return await requestNativeHostBoolean('payment.request', {
|
||||
|
||||
Reference in New Issue
Block a user