add ws 链接确认
CI / changes (push) Successful in 1m43s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 37s
CI / chore (push) Successful in 1s
CI / equipment (push) Successful in 27s
CI / express (push) Successful in 0s
CI / factory (push) Successful in 0s
CI / message (push) Successful in 0s
CI / order (push) Successful in 1s
CI / payment (push) Successful in 0s
CI / percutaneous (push) Successful in 36s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / store (push) Successful in 0s
CI / support (push) Successful in 0s
CI / task (push) Successful in 0s
CI / user (push) Successful in 1s
CI / water (push) Successful in 0s
CI / wecom (push) Successful in 1s

This commit is contained in:
2026-10-23 13:20:18 +08:00
parent 0346297803
commit 38cffc2f2a
11 changed files with 182 additions and 27 deletions
@@ -30,17 +30,21 @@ func NewGetWsCodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWsCo
}
func (l *GetWsCodeLogic) GetWsCode(in *percutaneous.GetWsCodeRequest) (*percutaneous.Response, error) {
adminInfo := utils.GetUserFromCtx(l.ctx)
if adminInfo.ID < utils.NumberOne {
return l.fail(utils.ErrorNoLoginInfo)
id := in.UserId
if id < utils.NumberOne {
adminInfo := utils.GetUserFromCtx(l.ctx)
if adminInfo.ID < utils.NumberOne {
return l.fail(utils.ErrorNoLoginInfo)
}
id = adminInfo.ID
}
Type := "app"
if in.Type == utils.NumberOne {
Type = "operation"
Type := WsTypeApp
if in.Type == utils.NumberTwo {
Type = WsTypeOperation
}
key := utils.MD5Encrypt(fmt.Sprintf("%d%s%s", adminInfo.ID, dao.WsCode, Type))
key := utils.MD5Encrypt(fmt.Sprintf("%d%s%s", id, dao.WsCode, Type))
redisKey := pkgws.RedisKeyQRSession + key
payload, err := jsoniter.MarshalToString(pkgws.Session{