v3.8.2 修复数据库用户表 头像列为 null 时不显示默认头像问题
This commit is contained in:
parent
d1053d55ad
commit
2ad73cd69a
|
@ -107,7 +107,7 @@ const user = {
|
|||
|
||||
res = res.data; // 读取 data 数据
|
||||
const user = res.user
|
||||
const avatar = user.avatar === "" ? require("@/assets/images/profile.jpg") : user.avatar;
|
||||
const avatar = ( user.avatar === "" || user.avatar == null ) ? require("@/assets/images/profile.jpg") : user.avatar;
|
||||
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
commit('SET_ROLES', res.roles)
|
||||
commit('SET_PERMISSIONS', res.permissions)
|
||||
|
|
Loading…
Reference in New Issue