diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 6bb5de5..0ac764c 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -42,6 +42,9 @@ + + 返回系统 + 个人中心 @@ -102,6 +105,8 @@ export default { data() { return { avatarFlag: false, + userInfo: JSON.parse(sessionStorage.getItem("USER_INFO")), + userName: "admin", }; }, methods: { @@ -109,12 +114,17 @@ export default { const isGovernmentAffairsNetwork = localStorage.getItem( "isGovernmentAffairsNetwork" ); - const G_USER_INFO = JSON.parse(localStorage.getItem("G_USER_INFO")); - if (isGovernmentAffairsNetwork == "1") { - this.userName = G_USER_INFO.data.username; + if (this.userInfo.userName == "admin") { + this.userName = this.userInfo.userName; } else { - this.userName = this.dept.deptName + " " + this.username; + this.userName = this.userInfo.lawLevel + " " + this.userInfo.nickName; } + // const G_USER_INFO = JSON.parse(localStorage.getItem("G_USER_INFO")); + // if (isGovernmentAffairsNetwork == "1") { + // this.userName = G_USER_INFO.data.username; + // } else { + // this.userName = this.dept.deptName + " " + this.username; + // } }, getDrop(e) { this.avatarFlag = e;