🐛 fix session bug
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user