gokins/service/utilService/mids.go
2020-09-30 15:58:22 +08:00

14 lines
212 B
Go

package utilService
import "github.com/gin-gonic/gin"
func MidNeedLogin(c *gin.Context) {
lgusr := CurrUser(c)
if lgusr == nil {
c.String(403, "not login")
c.Abort()
return
}
c.Set("lguser", lgusr)
}