release: v0.1.3

This commit is contained in:
2026-04-03 14:24:29 +08:00
parent 98839e9782
commit 83ee4bb5ea
14 changed files with 413 additions and 132 deletions

View File

@@ -23,7 +23,7 @@ var (
)
func init() {
if conf.Mode != gin.ReleaseMode {
if conf.IsBuildDebugMode() {
AllowOrigins = []string{"*"}
AllowMethods = []string{"*"}
AllowHeaders = []string{"*"}
@@ -48,9 +48,7 @@ func SetupRouter() *gin.Engine {
AllowCredentials: true,
MaxAge: 12 * time.Hour,
}))
if conf.IsDebugMode() {
r.Use(middleware.DebugHTTPLog())
}
r.Use(middleware.DebugHTTPLog())
wkHandler := handler.NewWKHandler()
sessionMiddleware := middleware.SessionMiddleware(wkHandler.Session)
// schedule.StartCron(wkHandler.Session)
@@ -68,14 +66,14 @@ func SetupRouter() *gin.Engine {
{
api.POST("/login", wkHandler.Login)
api.Any("/version", handler.Version)
if conf.IsDebugMode() {
debug := api.Group("/debug")
{
debug.GET("/logs", handler.DebugLogs)
debug.GET("/logs/download", handler.DebugLogsDownload)
debug.GET("/logs/ws", handler.DebugLogWS)
debug.GET("/ws/logs", handler.DebugLogWS)
}
debug := api.Group("/debug")
{
debug.GET("/config", handler.DebugConfig)
debug.POST("/config", handler.UpdateDebugConfig)
debug.GET("/logs", handler.DebugLogs)
debug.GET("/logs/download", handler.DebugLogsDownload)
debug.GET("/logs/ws", handler.DebugLogWS)
debug.GET("/ws/logs", handler.DebugLogWS)
}
v1 := api.Group("/v1")
{