Cloudreve/routers/controllers/user.go

19 lines
331 B
Go
Raw Normal View History

2019-11-05 19:49:56 +08:00
package controllers
import (
"cloudreve/service/user"
2019-11-05 19:49:56 +08:00
"github.com/gin-gonic/gin"
)
// UserLogin 用户登录
func UserLogin(c *gin.Context) {
var service service.UserLoginService
if err := c.ShouldBindJSON(&service); err == nil {
2019-11-06 16:42:13 +08:00
res := service.Login(c)
c.JSON(200, res)
2019-11-05 19:49:56 +08:00
} else {
c.JSON(200, ErrorResponse(err))
}
}