fix
This commit is contained in:
parent
ca6a10c373
commit
4342e09699
|
@ -67,7 +67,8 @@ func FinishRegister(svcCtx *svc.ServiceContext, user *gmodel.FsUser, token *auth
|
|||
}
|
||||
|
||||
func CommonNotify(WebsocketAddr, wid string, event *wevent.WebsocketEvent) error {
|
||||
tp := requests.Post(fmt.Sprintf("%s/api/websocket/common_notify", WebsocketAddr))
|
||||
reqWebsocketAddr := fmt.Sprintf("%s/api/websocket/common_notify", WebsocketAddr)
|
||||
tp := requests.Post(reqWebsocketAddr)
|
||||
tp.SetBodyJson(requests.M{
|
||||
"wid": wid,
|
||||
"data": event,
|
||||
|
@ -80,7 +81,11 @@ func CommonNotify(WebsocketAddr, wid string, event *wevent.WebsocketEvent) error
|
|||
}
|
||||
|
||||
result := wresp.Json()
|
||||
logx.Error(result.String())
|
||||
|
||||
if !result.Get("code").Exists() {
|
||||
return fmt.Errorf("send %s is error", reqWebsocketAddr)
|
||||
}
|
||||
|
||||
if result.Get("code").Int() != 200 {
|
||||
return fmt.Errorf("%s", result.String())
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ func (l *UserResetPasswordLogic) UserResetPassword(req *types.RequestUserResetPa
|
|||
}
|
||||
|
||||
event := wevent.NewWebsocketEventSuccess(wevent.UserResetToken, rt.TraceId)
|
||||
err = CommonNotify(l.svcCtx.Config.MainAddress, rt.Wid, event)
|
||||
err = CommonNotify(l.svcCtx.Config.WebsocketAddr, rt.Wid, event)
|
||||
if err != nil {
|
||||
logx.Error(err, rt.TraceId)
|
||||
return resp.SetStatusWithMessage(basic.CodeResetPasswordErr, err.Error())
|
||||
|
|
Loading…
Reference in New Issue
Block a user