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