mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-29 20:31:56 +08:00
Feat: User login
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"cloudreve/middleware"
|
||||
"cloudreve/pkg/conf"
|
||||
"cloudreve/routers/controllers"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -8,13 +10,16 @@ import (
|
||||
func InitRouter() *gin.Engine {
|
||||
r := gin.Default()
|
||||
|
||||
// 中间件
|
||||
r.Use(middleware.Session(conf.SystemConfig.SessionSecret))
|
||||
|
||||
// 顶层路由分组
|
||||
v3 := r.Group("/Api/V3")
|
||||
{
|
||||
// 测试用路由
|
||||
v3.GET("Ping", controllers.Ping)
|
||||
// 用户登录
|
||||
v3.POST("User/Login", controllers.UserLogin)
|
||||
v3.POST("User/Session", controllers.UserLogin)
|
||||
|
||||
}
|
||||
return r
|
||||
|
||||
Reference in New Issue
Block a user