package middleware

import (
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
)

func WxAuth(r *ghttp.Request) {
	token := r.Header.Get("Token")
	if !r.Session.Contains(token) {
		r.Response.WriteJson(g.Map{
			"code": 403,
			"msg": "请重新登录",
		})

		return
	}

	r.Middleware.Next()
}
