fix
This commit is contained in:
@@ -57,7 +57,7 @@ func FinishRegister(svcCtx *svc.ServiceContext, user *gmodel.FsUser, token *auth
|
||||
event.Data = wevent.DataEmailRegister{
|
||||
JwtToken: jwtToken,
|
||||
}
|
||||
err = CommonNotify(svcCtx.Config.MainAddress, token.Wid, event)
|
||||
err = CommonNotify(svcCtx.Config.WebsocketAddr, token.Wid, event)
|
||||
if err != nil {
|
||||
// logx.Error(err, token.TraceId)
|
||||
return err
|
||||
@@ -66,8 +66,8 @@ func FinishRegister(svcCtx *svc.ServiceContext, user *gmodel.FsUser, token *auth
|
||||
return nil
|
||||
}
|
||||
|
||||
func CommonNotify(MainAddress, wid string, event *wevent.WebsocketEvent) error {
|
||||
tp := requests.Post(fmt.Sprintf("%s/api/websocket/common_notify", MainAddress))
|
||||
func CommonNotify(WebsocketAddr, wid string, event *wevent.WebsocketEvent) error {
|
||||
tp := requests.Post(fmt.Sprintf("%s/api/websocket/common_notify", WebsocketAddr))
|
||||
tp.SetBodyJson(requests.M{
|
||||
"wid": wid,
|
||||
"data": event,
|
||||
@@ -165,6 +165,13 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma
|
||||
return resp.SetStatus(basic.CodeDbSqlErr, err.Error())
|
||||
}
|
||||
|
||||
event := wevent.NewWebsocketEventSuccess(wevent.UserResetToken, rt.TraceId)
|
||||
err = CommonNotify(l.svcCtx.Config.MainAddress, rt.Wid, event)
|
||||
if err != nil {
|
||||
logx.Error(err, rt.TraceId)
|
||||
return resp.SetStatus(basic.CodeResetPasswordErr, err.Error())
|
||||
}
|
||||
|
||||
return resp.SetStatus(basic.CodeOK)
|
||||
|
||||
default:
|
||||
|
||||
@@ -36,6 +36,8 @@ func (l *UserResetTokenLogic) UserResetToken(req *types.RequestUserResetToken, u
|
||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||
// userinfo 传入值时, 一定不为null
|
||||
|
||||
return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, "废弃")
|
||||
|
||||
user, err := l.svcCtx.AllModels.FsUser.FindUserByEmail(context.TODO(), req.Email)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
|
||||
Reference in New Issue
Block a user