🐛 fixed the issue that third-party login sessions were missing

This commit is contained in:
2024-12-20 01:19:29 +08:00
parent 49831fc4d0
commit 40d073db0f
27 changed files with 556 additions and 308 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/rest/httpx"
http2 "schisandra-album-cloud-microservices/app/core/api/common/http"
"schisandra-album-cloud-microservices/app/core/api/common/response"
"schisandra-album-cloud-microservices/app/core/api/internal/logic/oauth"
"schisandra-album-cloud-microservices/app/core/api/internal/svc"
@@ -21,7 +22,7 @@ func GiteeCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
l := oauth.NewGiteeCallbackLogic(r.Context(), svcCtx)
err := l.GiteeCallback(w, r, &req)
data, err := l.GiteeCallback(w, r, &req)
if err != nil {
logx.Error(err)
httpx.WriteJsonCtx(
@@ -30,7 +31,7 @@ func GiteeCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
http.StatusInternalServerError,
response.ErrorWithI18n(r.Context(), "system.error"))
} else {
httpx.Ok(w)
http2.OkHTML(w, data)
}
}
}

View File

@@ -5,7 +5,7 @@ import (
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/rest/httpx"
http2 "schisandra-album-cloud-microservices/app/core/api/common/http"
"schisandra-album-cloud-microservices/app/core/api/common/response"
"schisandra-album-cloud-microservices/app/core/api/internal/logic/oauth"
"schisandra-album-cloud-microservices/app/core/api/internal/svc"
@@ -21,7 +21,7 @@ func GithubCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
l := oauth.NewGithubCallbackLogic(r.Context(), svcCtx)
err := l.GithubCallback(w, r, &req)
data, err := l.GithubCallback(w, r, &req)
if err != nil {
logx.Error(err)
httpx.WriteJsonCtx(
@@ -30,7 +30,7 @@ func GithubCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
http.StatusInternalServerError,
response.ErrorWithI18n(r.Context(), "system.error"))
} else {
httpx.Ok(w)
http2.OkHTML(w, data)
}
}
}

View File

@@ -5,7 +5,7 @@ import (
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/rest/httpx"
http2 "schisandra-album-cloud-microservices/app/core/api/common/http"
"schisandra-album-cloud-microservices/app/core/api/common/response"
"schisandra-album-cloud-microservices/app/core/api/internal/logic/oauth"
"schisandra-album-cloud-microservices/app/core/api/internal/svc"
@@ -21,7 +21,7 @@ func QqCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
l := oauth.NewQqCallbackLogic(r.Context(), svcCtx)
err := l.QqCallback(w, r, &req)
data, err := l.QqCallback(w, r, &req)
if err != nil {
logx.Error(err)
httpx.WriteJsonCtx(
@@ -30,7 +30,7 @@ func QqCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
http.StatusInternalServerError,
response.ErrorWithI18n(r.Context(), "system.error"))
} else {
httpx.Ok(w)
http2.OkHTML(w, data)
}
}
}