Merge pull request #4 from 764763903a/test

修复安全问题
This commit is contained in:
764763903a 2021-09-02 11:04:50 +08:00 committed by GitHub
commit 6568aaf2c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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("登录")
}