diff --git a/src/assets/image/index/company2.png b/src/assets/image/index/company2.png new file mode 100644 index 0000000..73d50d1 Binary files /dev/null and b/src/assets/image/index/company2.png differ diff --git a/src/components/login.vue b/src/components/login.vue index bb58fa8..d4e205a 100644 --- a/src/components/login.vue +++ b/src/components/login.vue @@ -218,7 +218,7 @@ onUnmounted(() => { background-color: rgba(0, 0, 0, 0.75); z-index: 1000101; } -.el-message { +:global(.el-message) { z-index: 1000102 !important; } .login-container { diff --git a/src/views/HeadMenu.vue b/src/views/HeadMenu.vue index c981210..3b3af67 100644 --- a/src/views/HeadMenu.vue +++ b/src/views/HeadMenu.vue @@ -110,17 +110,8 @@ const approval_status = ref(-1); const token = ref(userStore.token); const mobile = ref(userStore.mobilePhone); -watch(userStore, (newVal) => { - token.value = newVal.token; - mobile.value = newVal.mobilePhone.replace( - /(^\d{3})(\d+)(\d{4})/g, - "$1****$3" - ); - isLoggedIn.value = !!token.value; -}); - -// 每次页面加载时检查 token -onMounted(() => { +// 获取审核状态的函数 +const fetchApprovalStatus = () => { const mobile = localStorage.getItem("mobilePhone"); if (mobile) { getApproval_status().then((res) => { @@ -130,6 +121,38 @@ onMounted(() => { } }); } +}; + +watch(userStore, (newVal) => { + token.value = newVal.token; + // 更新手机号并格式化 + if (newVal.mobilePhone) { + mobile.value = newVal.mobilePhone.replace( + /(^\d{3})(\d+)(\d{4})/g, + "$1****$3" + ); + } + isLoggedIn.value = !!token.value; + + // 当登录状态变化且为已登录时,重新获取审核状态 + if (isLoggedIn.value) { + fetchApprovalStatus(); + } +}); + +// 页面加载时获取审核状态 +onMounted(() => { + fetchApprovalStatus(); + + // 监听窗口 resize 事件 + resizeHandler = () => { + const clientWidth = document.documentElement.clientWidth; + const isMobile = clientWidth <= 768; + if (!isMobile && isMenuOpen.value) { + isMenuOpen.value = false; + } + }; + window.addEventListener("resize", resizeHandler); }); // 监听 userStore.isLoggedIn 的变化 @@ -169,7 +192,8 @@ const logout = () => { userStore.removeMobilePhone(); userStore.removeIdentity(); isLoggedIn.value = false; // 更新登录状态为未登录 - router.push("/"); // 可以根据需求跳转到其他页面 + approval_status.value = -1; // 重置审核状态 + router.push("/"); // 跳转到首页 }; // 汉堡菜单相关逻辑 @@ -179,18 +203,8 @@ const toggleMenu = () => { isMenuOpen.value = !isMenuOpen.value; }; -// 监听窗口 resize 事件 +// 窗口resize处理函数 let resizeHandler: () => void; -onMounted(() => { - resizeHandler = () => { - const clientWidth = document.documentElement.clientWidth; - const isMobile = clientWidth <= 768; - if (!isMobile && isMenuOpen.value) { - isMenuOpen.value = false; - } - }; - window.addEventListener("resize", resizeHandler); -}); onUnmounted(() => { window.removeEventListener("resize", resizeHandler); @@ -203,6 +217,10 @@ onUnmounted(() => { width: 100%; padding: 15px 20px; display: flex; + position: fixed; + top:0; + left: 0; + z-index: 1000; align-items: center; justify-content: space-between; background-color: #fff; diff --git a/src/views/feedback/FeedBack.vue b/src/views/feedback/FeedBack.vue index 8cafa5c..15ee362 100644 --- a/src/views/feedback/FeedBack.vue +++ b/src/views/feedback/FeedBack.vue @@ -77,12 +77,13 @@ const uploadSubmit = ({ file }) => {