no message
This commit is contained in:
55
app.vue
55
app.vue
@@ -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">
|
||||
* {
|
||||
|
||||
Reference in New Issue
Block a user