From 9d408b549b899631db29af772ee4e96f4c49a91c Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期四, 25 十二月 2025 15:53:56 +0800
Subject: [PATCH] 相关推送
---
src/layout/components/Navbar.vue | 65 ++++++++++++++++++--------------
1 files changed, 36 insertions(+), 29 deletions(-)
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9cbc66b..583172c 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -45,7 +45,14 @@
trigger="click"
>
<div class="avatar-wrapper">
- <img :src="avatar" class="user-avatar" />
+ <img
+ :src="
+ sex == 1
+ ? require('@/assets/images/yisn.jpg')
+ : require('@/assets/images/yisna.jpg')
+ "
+ class="user-avatar"
+ />
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
@@ -85,7 +92,7 @@
SizeSelect,
Search,
RuoYiGit,
- RuoYiDoc,
+ RuoYiDoc
},
computed: {
...mapGetters(["sidebar", "avatar", "device"]),
@@ -96,41 +103,41 @@
set(val) {
this.$store.dispatch("settings/changeSetting", {
key: "showSettings",
- value: val,
+ value: val
});
- },
+ }
},
topNav: {
get() {
return this.$store.state.settings.topNav;
- },
- },
+ }
+ }
},
data() {
return {
isBadgeHidden: true,
badgeVal: 0,
+ sex: this.$store.state.user.sex
};
},
mounted() {
- this.returs();
+ // this.returs();
},
methods: {
- async returs() {
- await listSystemmessageCount()
- .then((res) => {
- this.badgeVal = res.data;
-
- if (this.badgeVal > 0) {
- this.isBadgeHidden = false;
- }
- })
- .catch((error) => {});
- },
+ // async returs() {
+ // await listSystemmessageCount()
+ // .then((res) => {
+ // this.badgeVal = res.data;
+ // console.log('璺�');
+ // if (this.badgeVal > 0) {
+ // this.isBadgeHidden = false;
+ // }
+ // })
+ // .catch((error) => {});
+ // },
clickMessage() {
this.$router.push({
- path: "/message",
-
+ path: "/message"
});
},
toggleSideBar() {
@@ -140,7 +147,7 @@
this.$confirm("纭畾娉ㄩ攢骞堕��鍑虹郴缁熷悧锛�", "鎻愮ず", {
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
- type: "warning",
+ type: "warning"
})
.then(() => {
this.$store.dispatch("LogOut").then(() => {
@@ -148,21 +155,21 @@
});
})
.catch(() => {});
- },
+ }
},
watch: {
- badgeVal: function () {
+ badgeVal: function() {
const timer = setInterval(() => {
this.returs();
- },5000);
- this.$once("hook:beforeDestroy",()=>{
+ }, 5000);
+ this.$once("hook:beforeDestroy", () => {
clearInterval(timer);
- })
- },
- },
+ });
+ }
+ }
};
</script>
-<style lang="scss" >
+<style lang="scss">
.el-badge {
.el-badge__content.is-fixed {
top: 13px !important ;
--
Gitblit v1.9.3