CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.
add v3 file path
LinkLeong3f1c7098bdeb
diff --git a/drivers/onedrive/util.go b/drivers/onedrive/util.goindex e6ceeb7..8d7fa2f 100644--- a/drivers/onedrive/util.go+++ b/drivers/onedrive/util.go@@ -173,7 +173,7 @@ func GetConfig() Onedrive {config.ClientID = client_idconfig.ClientSecret = client_secretconfig.RootFolderID = "/"- config.AuthUrl = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=" + client_id + "&response_type=code&redirect_uri=https%3A%2F%2Fcloudoauth.files.casaos.app%2Fcallback&scope=offline_access+files.readwrite.all&state=${HOST}%2Fv2%2Frecover%2FOnedrive"+ config.AuthUrl = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=" + client_id + "&response_type=code&redirect_uri=https%3A%2F%2Fcloudoauth.files.casaos.app&scope=offline_access+files.readwrite.all&state=${HOST}%2Fv2%2Frecover%2FOnedrive"config.Icon = "./img/driver/OneDrive.svg"config.Region = "global"config.RedirectUri = "https://cloudoauth.files.casaos.app"diff --git a/main.go b/main.goindex 0240a0e..8e3cca1 100644--- a/main.go+++ b/main.go@@ -109,10 +109,12 @@ func main() {v2Router := route.InitV2Router()v2DocRouter := route.InitV2DocRouter(_docHTML, _docYAML)+ v3File := route.InitFile()mux := &util_http.HandlerMultiplexer{HandlerMap: map[string]http.Handler{"v1": v1Router,"v2": v2Router,+ "v3": v3File,"doc": v2DocRouter,},}@@ -146,6 +148,7 @@ func main() {"/v1/test",route.V2APIPath,route.V2DocPath,+ route.V3FilePath,}for _, apiPath := range routers {err = service.MyService.Gateway().CreateRoute(&model.Route{diff --git a/route/v2.go b/route/v2.goindex dbe7ead..e68c566 100644--- a/route/v2.go+++ b/route/v2.go@@ -27,8 +27,9 @@ import (var (_swagger *openapi3.T- V2APIPath string- V2DocPath string+ V2APIPath string+ V2DocPath string+ V3FilePath string)func init() {@@ -46,6 +47,7 @@ func init() {V2APIPath = strings.TrimRight(u.Path, "/")V2DocPath = "/doc" + V2APIPath+ V3FilePath = "/v3/file"}func InitV2Router() http.Handler {