plus会员,尝试更换一个新的token时提示token is expired,确定token在有效期,且在new.oaifree.com或通过chat2api中可以正常使用,应该是替换token的逻辑有问题
日志如下:
{"level":"error","ts":1724042271.629171,"caller":"service/share.go:231","msg":"RefreshShareToken error","err":"{\"detail\":\"token has invalid claims: token is expired\"}","stacktrace":"PandoraHelper/internal/service.(*shareService).GetShareTokenByAccessToken\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/share.go:231\nPandoraHelper/internal/service.(*shareService).RefreshShareToken\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/share.go:288\nPandoraHelper/internal/service.(*accountService).RefreshAccount\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/account.go:84\nPandoraHelper/internal/service.(*accountService).Update\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/account.go:95\nPandoraHelper/internal/handler.(*AccountHandler).UpdateAccount\n\tD:/dev/projects/goProjects/PandoraHelper/internal/handler/account.go:81\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.StrictAuth.func10\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/jwt.go:38\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.RequestLogMiddleware.func8\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/log.go:32\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.ResponseLogMiddleware.func7\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/log.go:40\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.CORSMiddleware.func6\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/cors.go:21\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/ulule/limiter/v3/drivers/middleware/gin.(*Middleware).Handle\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/ulule/limiter/v3@v3.11.2/drivers/middleware/gin/middleware.go:64\ngithub.com/ulule/limiter/v3/drivers/middleware/gin.NewMiddleware.func1\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/ulule/limiter/v3@v3.11.2/drivers/middleware/gin/middleware.go:35\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/gin-gonic/gin.LoggerWithConfig.func1\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620\ngithub.com/gin-gonic/gin.(*Engine).ServeHTTP\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576\nnet/http.serverHandler.ServeHTTP\n\tD:/dev/env/env/src/net/http/server.go:3137\nnet/http.(*conn).serve\n\tD:/dev/env/env/src/net/http/server.go:2039"}
plus会员,尝试更换一个新的token时提示token is expired,确定token在有效期,且在new.oaifree.com或通过chat2api中可以正常使用,应该是替换token的逻辑有问题
日志如下:
{"level":"error","ts":1724042271.629171,"caller":"service/share.go:231","msg":"RefreshShareToken error","err":"{\"detail\":\"token has invalid claims: token is expired\"}","stacktrace":"PandoraHelper/internal/service.(*shareService).GetShareTokenByAccessToken\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/share.go:231\nPandoraHelper/internal/service.(*shareService).RefreshShareToken\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/share.go:288\nPandoraHelper/internal/service.(*accountService).RefreshAccount\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/account.go:84\nPandoraHelper/internal/service.(*accountService).Update\n\tD:/dev/projects/goProjects/PandoraHelper/internal/service/account.go:95\nPandoraHelper/internal/handler.(*AccountHandler).UpdateAccount\n\tD:/dev/projects/goProjects/PandoraHelper/internal/handler/account.go:81\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.StrictAuth.func10\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/jwt.go:38\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.RequestLogMiddleware.func8\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/log.go:32\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.ResponseLogMiddleware.func7\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/log.go:40\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\nPandoraHelper/internal/server.NewHTTPServer.CORSMiddleware.func6\n\tD:/dev/projects/goProjects/PandoraHelper/internal/middleware/cors.go:21\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/ulule/limiter/v3/drivers/middleware/gin.(*Middleware).Handle\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/ulule/limiter/v3@v3.11.2/drivers/middleware/gin/middleware.go:64\ngithub.com/ulule/limiter/v3/drivers/middleware/gin.NewMiddleware.func1\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/ulule/limiter/v3@v3.11.2/drivers/middleware/gin/middleware.go:35\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/gin-gonic/gin.LoggerWithConfig.func1\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240\ngithub.com/gin-gonic/gin.(*Context).Next\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\ngithub.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620\ngithub.com/gin-gonic/gin.(*Engine).ServeHTTP\n\tC:/Users/Pengdehua/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576\nnet/http.serverHandler.ServeHTTP\n\tD:/dev/env/env/src/net/http/server.go:3137\nnet/http.(*conn).serve\n\tD:/dev/env/env/src/net/http/server.go:2039"}