From d7aa9a44b7c085ccfbdb4e3e339249e61b357faf Mon Sep 17 00:00:00 2001 From: EUForest Date: Sat, 8 Nov 2025 17:05:52 +0800 Subject: [PATCH] Add: Try to get the device ID from the request parameters --- internal/logic/public/user/ws/deviceWsConnectLogic.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/logic/public/user/ws/deviceWsConnectLogic.go b/internal/logic/public/user/ws/deviceWsConnectLogic.go index a52bef4..5024a7f 100644 --- a/internal/logic/public/user/ws/deviceWsConnectLogic.go +++ b/internal/logic/public/user/ws/deviceWsConnectLogic.go @@ -35,8 +35,11 @@ func (l *DeviceWsConnectLogic) DeviceWsConnect(c *gin.Context) error { value := l.ctx.Value(constant.CtxKeyIdentifier) if value == nil || value.(string) == "" { - l.Errorf("DeviceWsConnectLogic DeviceWsConnect identifier is empty") - return errors.Wrapf(xerr.NewErrCode(xerr.InvalidParams), "identifier is empty") + value, _ = c.GetQuery("identifier") + if value == nil || value.(string) == "" { + l.Errorf("DeviceWsConnectLogic DeviceWsConnect identifier is empty") + return errors.Wrapf(xerr.NewErrCode(xerr.InvalidParams), "identifier is empty") + } } identifier := value.(string) _, err := l.svcCtx.UserModel.FindOneDeviceByIdentifier(l.ctx, identifier)