mirror of
https://github.com/HChaZZY/alist.git
synced 2025-12-22 10:06:28 +08:00
chore: set guest while token is empty
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"github.com/alist-org/alist/v3/internal/conf"
|
||||
"github.com/alist-org/alist/v3/internal/server/common"
|
||||
"github.com/alist-org/alist/v3/internal/server/controllers"
|
||||
"github.com/alist-org/alist/v3/internal/server/middlewares"
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -12,8 +13,9 @@ func Init(r *gin.Engine) {
|
||||
common.SecretKey = []byte(conf.Conf.JwtSecret)
|
||||
Cors(r)
|
||||
|
||||
api := r.Group("/api")
|
||||
api := r.Group("/api", middlewares.Auth)
|
||||
api.POST("/user/login", controllers.Login)
|
||||
api.GET("/user/current", controllers.CurrentUser)
|
||||
}
|
||||
|
||||
func Cors(r *gin.Engine) {
|
||||
|
||||
Reference in New Issue
Block a user