diff --git a/src/api/backup.js b/src/api/backup.js new file mode 100644 index 00000000..bd3e9c90 --- /dev/null +++ b/src/api/backup.js @@ -0,0 +1,18 @@ +import service from '@/utils/service' + +const baseUrl = '/api/admin/backups' + +const backupApi = {} + +backupApi.importMarkdown = (formData, uploadProgress, cancelToken) => { + return service({ + url: `${baseUrl}/import/markdowns`, + timeout: 8640000, // 24 hours + data: formData, // form data + onUploadProgress: uploadProgress, + cancelToken: cancelToken, + method: 'post' + }) +} + +export default backupApi diff --git a/src/config/router.config.js b/src/config/router.config.js index a0df824c..0a28bb42 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -178,12 +178,12 @@ export const asyncRouterMap = [ // component: () => import('@/views/system/BackupList'), // meta: { title: '博客备份', hiddenHeaderContent: false } // }, - // { - // path: '/system/tools', - // name: 'ToolList', - // component: () => import('@/views/system/ToolList'), - // meta: { title: '小工具', hiddenHeaderContent: false } - // }, + { + path: '/system/tools', + name: 'ToolList', + component: () => import('@/views/system/ToolList'), + meta: { title: '小工具', hiddenHeaderContent: false } + }, { path: '/system/about', name: 'About', diff --git a/src/views/system/ToolList.vue b/src/views/system/ToolList.vue index 5e5e98c3..09cac66d 100644 --- a/src/views/system/ToolList.vue +++ b/src/views/system/ToolList.vue @@ -14,11 +14,11 @@ :bordered="false" :bodyStyle="{ padding: '16px' }" > -
支持 Hexo/Jekyll 导入并解析元数据
+支持 Hexo/Jekyll 文章导入并解析元数据
拖拽或点击选择 MarkDown 文件到此处
-拖拽或点击选择 Markdown 文件到此处
+支持多个文件同时上传
+