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) { export function addUser(data) {
return request({ return request({

View File

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