🐛 fix session bug

This commit is contained in:
landaiqing
2024-11-17 20:02:59 +08:00
parent 34c4690f80
commit 78a162a19a
72 changed files with 1304 additions and 453 deletions

View File

@@ -3,6 +3,7 @@ package client
import (
"net/http"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/rest/httpx"
"schisandra-album-cloud-microservices/app/core/api/common/utils"
@@ -15,8 +16,9 @@ func GenerateClientIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
clientIP := utils.GetClientIP(r)
l := client.NewGenerateClientIdLogic(r.Context(), svcCtx)
resp, err := l.GenerateClientId(clientIP)
if err != nil || resp.Code == 500 {
httpx.ErrorCtx(r.Context(), w, err)
if err != nil {
logx.Error(err)
httpx.WriteJsonCtx(r.Context(), w, http.StatusInternalServerError, resp)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}