mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +08:00
Fix: unable to save office file in root directory of WebDAV
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
model "github.com/HFO4/cloudreve/models"
|
||||
"github.com/HFO4/cloudreve/pkg/filesystem"
|
||||
"github.com/HFO4/cloudreve/pkg/util"
|
||||
"github.com/HFO4/cloudreve/pkg/webdav"
|
||||
@@ -12,18 +11,17 @@ var handler *webdav.Handler
|
||||
|
||||
func init() {
|
||||
handler = &webdav.Handler{
|
||||
Prefix: "/dav/",
|
||||
Prefix: "/dav",
|
||||
LockSystem: make(map[uint]webdav.LockSystem),
|
||||
}
|
||||
}
|
||||
|
||||
// ServeWebDAV 处理WebDAV相关请求
|
||||
func ServeWebDAV(c *gin.Context) {
|
||||
// 测试用user
|
||||
user, _ := model.GetUserByID(1)
|
||||
c.Set("user", &user)
|
||||
fs, err := filesystem.NewFileSystemFromContext(c)
|
||||
if err != nil {
|
||||
util.Log().Panic("%s", err)
|
||||
util.Log().Warning("无法为WebDAV初始化文件系统,%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
handler.ServeHTTP(c.Writer, c.Request, fs)
|
||||
|
||||
Reference in New Issue
Block a user