Feat: mount storage policy for folders in WebDAV

This commit is contained in:
HFO4
2020-02-13 15:27:40 +08:00
parent a0a9686959
commit 44d6ca487c
13 changed files with 76 additions and 12 deletions

View File

@ -97,8 +97,8 @@ func WebDAVAuth() gin.HandlerFunc {
}
// 密码正确?
ok, _ = expectedUser.CheckPassword(password)
if !ok {
webdav, err := model.GetWebdavByPassword(password, expectedUser.ID)
if err != nil {
c.Status(http.StatusUnauthorized)
c.Abort()
return
@ -112,6 +112,7 @@ func WebDAVAuth() gin.HandlerFunc {
}
c.Set("user", &expectedUser)
c.Set("webdav", webdav)
c.Next()
}
}