no message

This commit is contained in:
A1300399510
2024-01-02 19:03:39 +08:00
parent d7915dd321
commit 5ad39c3e39
9 changed files with 281 additions and 52 deletions

55
app.vue
View File

@@ -3,11 +3,58 @@
/details/{id} 详情 -->
<template>
<div>
<!-- <NuxtWelcome /> -->
<RouterView :key="$route.fullPath"></RouterView>
</div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<!-- <RouterView :key="$route.fullPath"></RouterView> -->
<RouterView></RouterView>
</template>
<script setup>
const route = useRoute()
watchEffect(() => {
if (typeof window !== "undefined" && route.path) {
if (window._hmt) window._hmt.push(["_trackPageview", route.fullPath])
if (window._czc) {
let location = window.location
let contentUrl = location.pathname + location.hash
let refererUrl = "/"
window._czc.push(["_trackPageview", contentUrl, refererUrl])
window._czc.push(["_setAutoPageview", false])
}
}
})
onMounted(() => {
// determineIsLogin()
})
let isNeedLogin = ref(false) // 是否需要登录状态
// 判断是否登录状态
const determineIsLogin = () => {
let count = 0
let timer = setInterval(() => {
if (Object.keys(window["userInfoWin"]).length !== 0) {
clearInterval(timer)
if (window["userInfoWin"]["uid"]) isNeedLogin.value = false
}
count++
if (count >= 10) clearInterval(timer)
}, 100)
}
// 跳转登录
const goLogin = () => {
if (typeof window === "undefined") return
if (Object.keys(window["userInfoWin"]).length !== 0) {
if (window["userInfoWin"]["uid"]) isNeedLogin.value = false
else ajax_login()
} else ajax_login()
}
provide("isNeedLogin", isNeedLogin)
provide("goLogin", goLogin)
</script>
<style lang="less">
* {