feat: 添加微信小程序环境判断,优化插件导入逻辑

This commit is contained in:
fanpeng 2025-06-12 16:59:13 +08:00
parent e8ce432e03
commit eee81fafa9
3 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,5 @@
// #ifdef MP-WEIXIN
module.exports = {
wx
}
// #endif

View File

@ -1,3 +1,4 @@
// #ifdef MP-WEIXIN
const appParams = {
appid: 123,
appOauthId: 'xxx',
@ -20,3 +21,4 @@ module.exports = {
return requirePlugin('wechat-p2p-player')
}
}
// #endif

View File

@ -126,8 +126,10 @@
import { useUserStore } from '@/stores/user'
import { passthrough } from '@/api/sdk'
import { getLockNetTokenRequest } from '@/api/lock'
// #ifdef MP-WEIXIN
import * as A from './exportForXp2pPlugin'
import * as B from './exportForPlayerPlugin'
// #endif
const $bluetooth = useBluetoothStore()
const $basic = useBasicStore()
@ -158,7 +160,9 @@
const isVideoLoaded = ref(false)
onMounted(async () => {
// #ifdef MP-WEIXIN
console.log(A, B)
// #endif
buttonInfo.value = await $basic.getButtonInfo()
const { code, data, message } = await passthrough({