1 Star 0 Fork 0

qw_1215 / fc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
auth.go 326 Bytes
一键复制 编辑 原始数据 按行查看 历史
qw_1215 提交于 2020-03-16 19:43 . 初始化项目
package middleware
import (
"gitee.com/qw_1215/fc/FC/app/service/user"
"github.com/gogf/gf/net/ghttp"
"net/http"
)
// 鉴权中间件,只有登录成功之后才能通过
func Auth(r *ghttp.Request) {
if user.IsSignedIn(r.Session) {
r.Middleware.Next()
} else {
r.Response.WriteStatus(http.StatusForbidden)
}
}
Go
1
https://gitee.com/qw_1215/fc.git
git@gitee.com:qw_1215/fc.git
qw_1215
fc
fc
478090fb42aa

搜索帮助

53164aa7 5694891 3bd8fe86 5694891