控制台打印当前支持的平台

This commit is contained in:
iqudoo
2026-05-02 13:46:34 +08:00
parent ede67b61b4
commit 548814fe38
3 changed files with 27 additions and 2 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,6 @@
import './polyfill';
import {
supportList,
onScanListener, offScanListener, setStatusListener, getStatus,
startScan, stopScan, scanVideo, scanImage, clear
} from './services/provider/scan';
@@ -24,6 +25,7 @@ function config(config) {
_readyPromise = Promise.resolve().then(() => {
printDebug('-------------------------------------');
printDebug('sdk_version:', getVersion());
printDebug('support_list:', supportList.map(item => item.name + ':' + item.support).join(', '));
printDebug('-------------------------------------');
initWxJssdk();
return Promise.resolve().then(() => {

View File

@@ -436,3 +436,26 @@ export function scanImage() {
__closed();
});
}
export const supportList = [
{
name: "bridge",
support: inRuntime()
},
{
name: "wx",
support: isSupportWxScan()
},
{
name: "web",
support: isSupportWebScan()
},
{
name: "image",
support: isSupportImageScan()
},
{
name: "scanner",
support: true
}
];