中间件使用

    鉴权处理

    1. import (
    2. "github.com/gogf/gf/net/ghttp"
    3. )
    4. // 鉴权中间件,只有登录成功之后才能通过
    5. r.Middleware.Next()
    6. } else {
    7. r.Response.WriteStatus(http.StatusForbidden)
    8. }