This commit is contained in:
Mrx
2026-01-21 14:02:56 +08:00
parent 94d00ac822
commit 571fee6088

View File

@@ -10,23 +10,14 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from 'vue'; import { useEnv } from '@/composables/useEnv';
// 定义一个响应式变量,表示是否在微信环境 // 使用全局的微信环境检测,与 App.vue 保持一致ss
const isWeChat = ref(false); const { isWeChat } = useEnv();
// 检查是否为微信环境
const checkIfWeChat = () => {
const userAgent = navigator.userAgent.toLowerCase();
isWeChat.value = /micromessenger/.test(userAgent);
};
// 在组件挂载后检查环境
onMounted(() => {
checkIfWeChat();
});
</script> </script>
<style scoped> <style scoped>
/* 遮罩层样式 */ /* 遮罩层样式 */
.wechat-overlay { .wechat-overlay {