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