🐛 fix windows onedrive path

pull/548/head
微凉 2021-11-15 19:07:04 +08:00
parent 74d86f8cc4
commit 82272fcbf5
1 changed files with 2 additions and 1 deletions

View File

@ -48,6 +48,7 @@ func init() {
func (o Onedrive) GetMetaUrl(account *model.Account, auth bool, path string) string { func (o Onedrive) GetMetaUrl(account *model.Account, auth bool, path string) string {
path = filepath.Join(account.RootFolder, path) path = filepath.Join(account.RootFolder, path)
log.Debugf(path)
host, _ := onedriveHostMap[account.Zone] host, _ := onedriveHostMap[account.Zone]
if auth { if auth {
return host.Oauth return host.Oauth
@ -55,7 +56,7 @@ func (o Onedrive) GetMetaUrl(account *model.Account, auth bool, path string) str
switch account.OnedriveType { switch account.OnedriveType {
case "onedrive": case "onedrive":
{ {
if path == "/" { if path == "/" || path == "\\" {
return fmt.Sprintf("%s/v1.0/me/drive/root", host.Api) return fmt.Sprintf("%s/v1.0/me/drive/root", host.Api)
} else { } else {
return fmt.Sprintf("%s/v1.0/me/drive/root:%s:", host.Api, path) return fmt.Sprintf("%s/v1.0/me/drive/root:%s:", host.Api, path)