mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-15 22:39:03 +08:00
cms
This commit is contained in:
@@ -85,6 +85,8 @@ func AdminLogin(c *gin.Context) {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
|
||||
return
|
||||
}
|
||||
resp.FaceURL = respPb.FaceURL
|
||||
resp.UserName = respPb.UserName
|
||||
resp.Token = respPb.Token
|
||||
c.JSON(http.StatusOK, gin.H{"errCode": respPb.CommonResp.ErrCode, "errMsg": respPb.CommonResp.ErrMsg, "data": resp})
|
||||
}
|
||||
|
||||
@@ -106,6 +106,15 @@ func (s *adminCMSServer) AdminLogin(_ context.Context, req *pbAdminCMS.AdminLogi
|
||||
resp.CommonResp.ErrMsg = constant.ErrTokenMalformed.ErrMsg
|
||||
return resp, nil
|
||||
}
|
||||
admin, err := imdb.GetUserByUserID(req.AdminID)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "failed", req.AdminID)
|
||||
resp.CommonResp.ErrCode = constant.ErrTokenUnknown.ErrCode
|
||||
resp.CommonResp.ErrMsg = constant.ErrTokenMalformed.ErrMsg
|
||||
return resp, nil
|
||||
}
|
||||
resp.UserName = admin.Nickname
|
||||
resp.FaceURL = admin.FaceURL
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user