Merge pull request #3 from 764763903a/test

x
This commit is contained in:
764763903a 2021-09-02 11:01:28 +08:00 committed by GitHub
commit 1d2f5ac4bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -108,15 +108,11 @@ func (c *BaseController) ResponseError(ps ...interface{}) *BaseController {
//Logined 登录
func (c *BaseController) Logined() *BaseController {
if models.Cdle { //作者调试
c.Master = true
return c
}
if v := c.GetSession("pin"); v == nil {
logs.Warn("test")
c.Ctx.Redirect(302, "/")
c.StopRun()
} else {
logs.Warn("登录成功")
c.PtPin = v.(string)
logs.Warn(v.(string))
if strings.Contains(models.Config.Master, v.(string)) {

View File

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