feat: user jwt login

This commit is contained in:
Noah Hsu
2022-06-25 21:34:44 +08:00
parent 306b90399c
commit c5295f4d72
16 changed files with 269 additions and 21 deletions

View File

@@ -1,12 +1,19 @@
package server
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/gin-contrib/cors"
"github.com/gin-gonic/gin"
)
func Init(r *gin.Engine) {
common.SecretKey = []byte(conf.Conf.JwtSecret)
Cors(r)
api := r.Group("/api")
api.POST("/user/login", controllers.Login)
}
func Cors(r *gin.Engine) {