mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +08:00
Feat: User/Me
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"cloudreve/pkg/serializer"
|
||||
"cloudreve/service/user"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -16,3 +17,11 @@ func UserLogin(c *gin.Context) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// UserMe 获取当前登录的用户
|
||||
func UserMe(c *gin.Context) {
|
||||
user := CurrentUser(c)
|
||||
res := serializer.BuildUserResponse(*user)
|
||||
c.JSON(200, res)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user