update navbar user dept

This commit is contained in:
lb 2024-02-22 16:23:19 +08:00
parent 1dd7fef171
commit ca2774ca28
2 changed files with 10 additions and 3 deletions

View File

@ -26,6 +26,13 @@ export function getUser(userId) {
})
}
export function getUserSimple(userId) {
return request({
url: '/system/user/getSimple?id=' + praseStrEmpty(userId),
method: 'get'
})
}
// 新增用户
export function addUser(data) {
return request({

View File

@ -26,7 +26,7 @@
</template>
<script>
import moment from 'moment'
import { getUser } from "@/api/system/user.js";
import { getUserSimple } from "@/api/system/user.js";
import {getPath} from "@/utils/ruoyi";
export default {
name: 'navRight',
@ -67,8 +67,8 @@ export default {
},
getUserMsg() {
let id = this.$store.getters.userId
getUser(id).then(res => {
this.dept = res.data.dept ? res.data.dept.name : ''
getUserSimple(id).then(res => {
this.dept = res.data.deptName ? res.data.dept.deptName : '---'
})
},
async logout() {