🐛 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,7 +3,9 @@ package captcha
import (
"net/http"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/rest/httpx"
"schisandra-album-cloud-microservices/app/core/api/internal/logic/captcha"
"schisandra-album-cloud-microservices/app/core/api/internal/svc"
)
@@ -13,7 +15,8 @@ func GenerateRotateCaptchaHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
l := captcha.NewGenerateRotateCaptchaLogic(r.Context(), svcCtx)
resp, err := l.GenerateRotateCaptcha()
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
logx.Error(err)
httpx.WriteJsonCtx(r.Context(), w, http.StatusInternalServerError, resp)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}

View File

@@ -3,7 +3,9 @@ package captcha
import (
"net/http"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/rest/httpx"
"schisandra-album-cloud-microservices/app/core/api/internal/logic/captcha"
"schisandra-album-cloud-microservices/app/core/api/internal/svc"
)
@@ -13,7 +15,8 @@ func GenerateSlideBasicCaptchaHandler(svcCtx *svc.ServiceContext) http.HandlerFu
l := captcha.NewGenerateSlideBasicCaptchaLogic(r.Context(), svcCtx)
resp, err := l.GenerateSlideBasicCaptcha()
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
logx.Error(err)
httpx.WriteJsonCtx(r.Context(), w, http.StatusInternalServerError, resp)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}