diff --git a/service/user.go b/service/user.go index 4ee56f9..28bc3db 100644 --- a/service/user.go +++ b/service/user.go @@ -54,8 +54,8 @@ func FindUserInfo(userId int32) *dto.UserRspDto { } rspUser := dto.ConvertFromUserDto(user) roles := QueryAuthRoleByUid(user.ID) - if len(roles) == 0 { - return rspUser + if len(roles) == 0 { // 如果没有指派用户时,指定普通用户信息 + roles = []*model.AuthRole{{ID: int32(dto.USER), Name: "普通用户"}} } rids := make([]int32, len(roles)) for i, r := range roles {