From 02950a964bb0dcc202bd1f4ddd6c6fc4a92c8048 Mon Sep 17 00:00:00 2001
From: feige <791364011@qq.com>
Date: 星期二, 15 四月 2025 17:14:50 +0800
Subject: [PATCH] 修改了bug
---
ruoyi-ui/src/store/modules/user.js | 4 ++++
ruoyi-ui/src/views/clanManager/commonUser/index.vue | 2 +-
ruoyi-ui/src/layout/components/Navbar.vue | 11 +++++++----
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue
index 4d3a648..6bb9626 100644
--- a/ruoyi-ui/src/layout/components/Navbar.vue
+++ b/ruoyi-ui/src/layout/components/Navbar.vue
@@ -176,20 +176,23 @@
setGreeting() {
const currentTime = new Date();
const currentHour = currentTime.getHours();
+ console.log(this.$store.state.user)
let name = this.$store.state.user.name
+ //alert(this.$store.state.user.userName)
+ let userName = this.$store.state.user.userName
let lnm = this.getLastName(name)
if(this.xm[lnm]!=null)
this.ximg = require("@/assets/images/"+this.xm[lnm])
else
this.ximg = require("@/assets/images/login_logo.png")
if (currentHour < 12) {
- this.greeting = "鏃╀笂濂�,"+name;
+ this.greeting = "鏃╀笂濂�,"+userName;
} else if (currentHour < 14) {
- this.greeting = "涓崍濂�,"+name;
+ this.greeting = "涓崍濂�,"+userName;
} else if (currentHour < 18) {
- this.greeting = "涓嬪崍濂�,"+name;
+ this.greeting = "涓嬪崍濂�,"+userName;
} else {
- this.greeting = "鏅氫笂濂�,"+name;
+ this.greeting = "鏅氫笂濂�,"+userName;
}
},
toggleSideBar() {
diff --git a/ruoyi-ui/src/store/modules/user.js b/ruoyi-ui/src/store/modules/user.js
index 9adfbb6..ad92ec3 100644
--- a/ruoyi-ui/src/store/modules/user.js
+++ b/ruoyi-ui/src/store/modules/user.js
@@ -19,6 +19,9 @@
SET_NAME: (state, name) => {
state.name = name
},
+ SET_USERNAME: (state, uname) => {
+ state.userName = uname
+ },
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
@@ -81,6 +84,7 @@
commit('SET_USERID', res.user.userId)
commit('SET_CLANID', res.user.clanId)
commit('SET_NAME', user.userName)
+ commit('SET_USERNAME', user.nickName)
commit('SET_AVATAR', avatar)
resolve(res)
}).catch(error => {
diff --git a/ruoyi-ui/src/views/clanManager/commonUser/index.vue b/ruoyi-ui/src/views/clanManager/commonUser/index.vue
index 4de28d4..e2d6b8e 100644
--- a/ruoyi-ui/src/views/clanManager/commonUser/index.vue
+++ b/ruoyi-ui/src/views/clanManager/commonUser/index.vue
@@ -109,7 +109,7 @@
<el-table-column label="鐢ㄦ埛濮撳悕" align="center" key="userName" prop="userName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="鎬у埆" align="center" key="sex" prop="sex" v-if="columns[2].visible" :show-overflow-tooltip="true" >
- <template slot-scope="scope">{{scope.row.sex==0? '鐢�': '濂�'}}</template>
+ <template slot-scope="scope">{{scope.row.sex===0? '鐢�': '濂�'}}</template>
</el-table-column>
<!-- <el-table-column label="鎵嬫満鍙风爜" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> -->
--
Gitblit v1.9.1