fix: 审核通过后允许切换已认证角色

This commit is contained in:
zetaloop
2026-04-03 19:24:35 +08:00
parent f1baefdf47
commit d1981c23ab
3 changed files with 28 additions and 11 deletions
@@ -13,7 +13,6 @@ import (
"juwan-backend/app/users/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
"google.golang.org/protobuf/proto"
)
type SwitchRoleLogic struct {
@@ -37,9 +36,9 @@ func (l *SwitchRoleLogic) SwitchRole(req *types.SwitchRoleReq) (resp *types.Empt
logx.Errorf("get user id from context: %v", err)
return nil, errors.New("illegal id")
}
_, err = l.svcCtx.UserRpc.UpdateUsers(l.ctx, &usercenter.UpdateUsersReq{
Id: id,
CurrentRole: proto.String(req.Role),
_, err = l.svcCtx.UserRpc.SwitchRole(l.ctx, &usercenter.SwitchRoleReq{
UserId: id,
NewRole: req.Role,
})
if err != nil {