From 0d1058818538a0764e9c55b3842480a202230231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Tue, 28 Nov 2023 17:30:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8Donedrive?= =?UTF-8?q?=E7=A9=BA=E9=97=B4=E9=97=AE=E9=A2=98=20#224?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/filesystem/onedrive/onedrive.ts | 6 +++--- pkg/filesystem/onedrive/rw.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/filesystem/onedrive/onedrive.ts b/pkg/filesystem/onedrive/onedrive.ts index 68f8ef1a..aa7ecfda 100644 --- a/pkg/filesystem/onedrive/onedrive.ts +++ b/pkg/filesystem/onedrive/onedrive.ts @@ -66,7 +66,7 @@ export default class OneDriveFileSystem implements FileSystem { parent = `:${parent}:`; } return this.request( - `https://graph.microsoft.com/v1.0/drive/special/approot${parent}/children`, + `https://graph.microsoft.com/v1.0/me/drive/special/approot${parent}/children`, { method: "POST", headers: myHeaders, @@ -119,7 +119,7 @@ export default class OneDriveFileSystem implements FileSystem { delete(path: string): Promise { return this.request( - `https://graph.microsoft.com/v1.0/drive/special/approot:${joinPath( + `https://graph.microsoft.com/v1.0/me/drive/special/approot:${joinPath( this.path, path )}`, @@ -143,7 +143,7 @@ export default class OneDriveFileSystem implements FileSystem { path = `:${path}:`; } return this.request( - `https://graph.microsoft.com/v1.0/drive/special/approot${path}/children` + `https://graph.microsoft.com/v1.0/me/drive/special/approot${path}/children` ).then((data) => { const list: File[] = []; data.value.forEach((val: any) => { diff --git a/pkg/filesystem/onedrive/rw.ts b/pkg/filesystem/onedrive/rw.ts index 11a8c39d..4f2029fa 100644 --- a/pkg/filesystem/onedrive/rw.ts +++ b/pkg/filesystem/onedrive/rw.ts @@ -18,7 +18,7 @@ export class OneDriveFileReader implements FileReader { async read(type?: "string" | "blob"): Promise { const data = await this.fs.request( - `https://graph.microsoft.com/v1.0/drive/special/approot:${joinPath( + `https://graph.microsoft.com/v1.0/me/drive/special/approot:${joinPath( this.file.path, this.file.name )}:/content`, @@ -69,7 +69,7 @@ export class OneDriveFileWriter implements FileWriter { myHeaders.append("Content-Type", "application/json"); const uploadUrl = await this.fs .request( - `https://graph.microsoft.com/v1.0/drive/special/approot:${this.path}:/createUploadSession`, + `https://graph.microsoft.com/v1.0/me/drive/special/approot:${this.path}:/createUploadSession`, { method: "POST", headers: myHeaders,