fix: 审核通过后允许切换已认证角色
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user