feat 图片显示&文件下载

This commit is contained in:
jxxghp
2023-08-26 19:28:04 +08:00
parent f2b51107fa
commit 3a9e85c821
5 changed files with 41 additions and 10 deletions

View File

@@ -8,16 +8,20 @@ const endpoints = {
mkdir: { url: '/filebrowser/mkdir?path={path}', method: 'get' },
delete: { url: '/filebrowser/delete?path={path}', method: 'get' },
download: { url: '/filebrowser/download?path={path}', method: 'get' },
image: { url: '/filebrowser/image?path={path}', method: 'get' },
}
// 读取下载目录
const systemEnv: Setting = inject('systemEnv') ?? {
DOWNLOAD_PATH: '/',
}
if (systemEnv?.DOWNLOAD_PATH && !systemEnv.DOWNLOAD_PATH?.endsWith('/'))
systemEnv.DOWNLOAD_PATH += '/'
</script>
<template>
<div>
<FileBrowser storages="local" :tree="false" :path="systemEnv.DOWNLOAD_PATH" :endpoints="endpoints" :axios="api" />
<FileBrowser storages="local" :tree="false" :path="systemEnv?.DOWNLOAD_PATH" :endpoints="endpoints" :axios="api" />
</div>
</template>