🎇 Pagination #257

This commit is contained in:
微凉
2022-01-04 21:21:27 +08:00
parent b60c7ecd9e
commit ef5cad1bf0
8 changed files with 98 additions and 43 deletions

View File

@ -16,7 +16,7 @@ func PathCheck(c *gin.Context) {
return
}
req.Path = utils.ParsePath(req.Path)
c.Set("req",req)
c.Set("req", req)
token := c.GetHeader("Authorization")
if token == conf.Token {
c.Next()
@ -29,7 +29,7 @@ func PathCheck(c *gin.Context) {
c.Abort()
return
}
} else if conf.CheckParent {
} else if conf.GetBool("check parent folder") {
if !common.CheckParent(utils.Dir(req.Path), req.Password) {
common.ErrorResp(c, fmt.Errorf("wrong password"), 401)
c.Abort()
@ -37,4 +37,4 @@ func PathCheck(c *gin.Context) {
}
}
c.Next()
}
}