修复安全问题

This commit is contained in:
ZJY 2021-09-02 11:04:05 +08:00
parent 8a596d7d33
commit a4b90cd744

View File

@ -325,11 +325,11 @@ func FetchJdCookieValue(key string, cookies string) string {
}
func (c *LoginController) IsAdmin() {
if v := c.GetSession("pin"); v == nil {
pin := c.GetString("pin")
if pin == "" {
c.Ctx.Redirect(302, "/")
c.StopRun()
} else {
pin := c.GetString("pin")
c.SetSession("pin", pin)
c.Ctx.WriteString("登录")
}