parent
a70efc8203
commit
c61aebab73
@ -1,18 +1,13 @@
|
|||||||
package controller
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/zggsong/gin-vue-demo/dto"
|
"github.com/zggsong/gin-vue-demo/dto"
|
||||||
"github.com/zggsong/gin-vue-demo/model"
|
"github.com/zggsong/gin-vue-demo/model"
|
||||||
|
"github.com/zggsong/gin-vue-demo/response"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Info(ctx *gin.Context) {
|
func Info(ctx *gin.Context) {
|
||||||
user, _ := ctx.Get("user")
|
user, _ := ctx.Get("user")
|
||||||
|
response.Success(ctx, gin.H{"user": dto.ToUserDto(user.(model.User))}, "")
|
||||||
ctx.JSON(http.StatusOK, gin.H{
|
|
||||||
"code": http.StatusOK,
|
|
||||||
"data": gin.H{"user": dto.ToUserDto(user.(model.User))},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue