From a327bea53b82de99790c5167b9853b24adf5dede Mon Sep 17 00:00:00 2001 From: weizhihong Date: Fri, 1 Sep 2023 17:34:41 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9F=A5=E8=AF=A2=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E8=B5=8B=E5=80=BC=E9=BB=98=E8=AE=A4=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 {