From a60505af7d569544a1fde7c853fa526ccf9e1ea7 Mon Sep 17 00:00:00 2001 From: Jixiong Su Date: Sun, 27 Oct 2024 19:53:22 +0800 Subject: [PATCH] Update router.go --- kernel/api/router.go | 55 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/kernel/api/router.go b/kernel/api/router.go index 07c0d7e8827..1956e075761 100644 --- a/kernel/api/router.go +++ b/kernel/api/router.go @@ -33,7 +33,8 @@ func ServeAPI(ginServer *gin.Engine) { ginServer.Handle("POST", "/api/system/loginAuth", model.LoginAuth) ginServer.Handle("POST", "/api/system/logoutAuth", model.LogoutAuth) ginServer.Handle("GET", "/api/system/getCaptcha", model.GetCaptcha) - ginServer.Handle("GET", "/api/icon/getDynamicIcon", getDynamicIcon) // 添加动态图标路由 + ginServer.Handle("GET", "/api/icon/getDynamicIcon", getDynamicIcon) // 添加动态图标路由 + // 需要鉴权 ginServer.Handle("POST", "/api/system/getEmojiConf", model.CheckAuth, getEmojiConf) @@ -90,7 +91,7 @@ func ServeAPI(ginServer *gin.Engine) { ginServer.Handle("POST", "/api/notebook/renameNotebook", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, renameNotebook) ginServer.Handle("POST", "/api/notebook/changeSortNotebook", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, changeSortNotebook) ginServer.Handle("POST", "/api/notebook/setNotebookIcon", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setNotebookIcon) - ginServer.Handle("POST", "/api/notebook/getNotebookInfo", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, getNotebookInfo) + ginServer.Handle("POST", "/api/notebook/getNotebookInfo", model.CheckAuth, model.CheckReadonly, getNotebookInfo) ginServer.Handle("POST", "/api/filetree/searchDocs", model.CheckAuth, searchDocs) ginServer.Handle("POST", "/api/filetree/listDocsByPath", model.CheckAuth, listDocsByPath) @@ -276,33 +277,33 @@ func ServeAPI(ginServer *gin.Engine) { ginServer.Handle("POST", "/api/asset/fullReindexAssetContent", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, fullReindexAssetContent) ginServer.Handle("POST", "/api/asset/statAsset", model.CheckAuth, model.CheckAdminRole, statAsset) - ginServer.Handle("POST", "/api/export/batchExportMd", model.CheckAuth, batchExportMd) - ginServer.Handle("POST", "/api/export/exportMd", model.CheckAuth, exportMd) - ginServer.Handle("POST", "/api/export/exportSY", model.CheckAuth, exportSY) - ginServer.Handle("POST", "/api/export/exportNotebookSY", model.CheckAuth, exportNotebookSY) - ginServer.Handle("POST", "/api/export/exportMdContent", model.CheckAuth, exportMdContent) - ginServer.Handle("POST", "/api/export/exportHTML", model.CheckAuth, exportHTML) - ginServer.Handle("POST", "/api/export/exportPreviewHTML", model.CheckAuth, exportPreviewHTML) - ginServer.Handle("POST", "/api/export/exportMdHTML", model.CheckAuth, exportMdHTML) - ginServer.Handle("POST", "/api/export/exportDocx", model.CheckAuth, exportDocx) - ginServer.Handle("POST", "/api/export/processPDF", model.CheckAuth, processPDF) + ginServer.Handle("POST", "/api/export/batchExportMd", model.CheckAuth, model.CheckAdminRole, batchExportMd) + ginServer.Handle("POST", "/api/export/exportMd", model.CheckAuth, model.CheckAdminRole, exportMd) + ginServer.Handle("POST", "/api/export/exportSY", model.CheckAuth, model.CheckAdminRole, exportSY) + ginServer.Handle("POST", "/api/export/exportNotebookSY", model.CheckAuth, model.CheckAdminRole, exportNotebookSY) + ginServer.Handle("POST", "/api/export/exportMdContent", model.CheckAuth, model.CheckAdminRole, exportMdContent) + ginServer.Handle("POST", "/api/export/exportHTML", model.CheckAuth, model.CheckAdminRole, exportHTML) + ginServer.Handle("POST", "/api/export/exportPreviewHTML", model.CheckAuth, model.CheckAdminRole, exportPreviewHTML) + ginServer.Handle("POST", "/api/export/exportMdHTML", model.CheckAuth, model.CheckAdminRole, exportMdHTML) + ginServer.Handle("POST", "/api/export/exportDocx", model.CheckAuth, model.CheckAdminRole, exportDocx) + ginServer.Handle("POST", "/api/export/processPDF", model.CheckAuth, model.CheckAdminRole, processPDF) ginServer.Handle("POST", "/api/export/preview", model.CheckAuth, exportPreview) - ginServer.Handle("POST", "/api/export/exportResources", model.CheckAuth, exportResources) - ginServer.Handle("POST", "/api/export/exportAsFile", model.CheckAuth, exportAsFile) - ginServer.Handle("POST", "/api/export/exportData", model.CheckAuth, exportData) - ginServer.Handle("POST", "/api/export/exportDataInFolder", model.CheckAuth, exportDataInFolder) - ginServer.Handle("POST", "/api/export/exportTempContent", model.CheckAuth, exportTempContent) + ginServer.Handle("POST", "/api/export/exportResources", model.CheckAuth, model.CheckAdminRole, exportResources) + ginServer.Handle("POST", "/api/export/exportAsFile", model.CheckAuth, model.CheckAdminRole, exportAsFile) + ginServer.Handle("POST", "/api/export/exportData", model.CheckAuth, model.CheckAdminRole, exportData) + ginServer.Handle("POST", "/api/export/exportDataInFolder", model.CheckAuth, model.CheckAdminRole, exportDataInFolder) + ginServer.Handle("POST", "/api/export/exportTempContent", model.CheckAuth, model.CheckAdminRole, exportTempContent) ginServer.Handle("POST", "/api/export/export2Liandi", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, export2Liandi) - ginServer.Handle("POST", "/api/export/exportReStructuredText", model.CheckAuth, exportReStructuredText) - ginServer.Handle("POST", "/api/export/exportAsciiDoc", model.CheckAuth, exportAsciiDoc) - ginServer.Handle("POST", "/api/export/exportTextile", model.CheckAuth, exportTextile) - ginServer.Handle("POST", "/api/export/exportOPML", model.CheckAuth, exportOPML) - ginServer.Handle("POST", "/api/export/exportOrgMode", model.CheckAuth, exportOrgMode) - ginServer.Handle("POST", "/api/export/exportMediaWiki", model.CheckAuth, exportMediaWiki) - ginServer.Handle("POST", "/api/export/exportODT", model.CheckAuth, exportODT) - ginServer.Handle("POST", "/api/export/exportRTF", model.CheckAuth, exportRTF) - ginServer.Handle("POST", "/api/export/exportEPUB", model.CheckAuth, exportEPUB) - ginServer.Handle("POST", "/api/export/exportAttributeView", model.CheckAuth, exportAttributeView) + ginServer.Handle("POST", "/api/export/exportReStructuredText", model.CheckAuth, model.CheckAdminRole, exportReStructuredText) + ginServer.Handle("POST", "/api/export/exportAsciiDoc", model.CheckAuth, model.CheckAdminRole, exportAsciiDoc) + ginServer.Handle("POST", "/api/export/exportTextile", model.CheckAuth, model.CheckAdminRole, exportTextile) + ginServer.Handle("POST", "/api/export/exportOPML", model.CheckAuth, model.CheckAdminRole, exportOPML) + ginServer.Handle("POST", "/api/export/exportOrgMode", model.CheckAuth, model.CheckAdminRole, exportOrgMode) + ginServer.Handle("POST", "/api/export/exportMediaWiki", model.CheckAuth, model.CheckAdminRole, exportMediaWiki) + ginServer.Handle("POST", "/api/export/exportODT", model.CheckAuth, model.CheckAdminRole, exportODT) + ginServer.Handle("POST", "/api/export/exportRTF", model.CheckAuth, model.CheckAdminRole, exportRTF) + ginServer.Handle("POST", "/api/export/exportEPUB", model.CheckAuth, model.CheckAdminRole, exportEPUB) + ginServer.Handle("POST", "/api/export/exportAttributeView", model.CheckAuth, model.CheckAdminRole, exportAttributeView) ginServer.Handle("POST", "/api/import/importStdMd", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, importStdMd) ginServer.Handle("POST", "/api/import/importData", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, importData)