mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-12-01 09:27:14 +00:00
web: load more for paged folders in pane and tree views
Failed loads keep loaded items and offer retry; stale responses after navigation are dropped; select-all and folder batch selection warn when pages remain unloaded. Co-authored-by: qaiu <[email protected]>
This commit is contained in:
6 files changed
+347
-18
No files matched your search
@@ -20,6 +20,7 @@
|
||||
<div v-else>
|
||||
<DirectoryTree
|
||||
:file-list="directoryData"
|
||||
:root-page-info="pageInfo"
|
||||
:share-url="url"
|
||||
:password="''"
|
||||
:view-mode="viewMode"
|
||||
@@ -42,6 +43,7 @@ export default {
|
||||
loading: true,
|
||||
error: '',
|
||||
directoryData: [],
|
||||
pageInfo: null,
|
||||
url: '',
|
||||
viewMode: 'pane'
|
||||
}
|
||||
@@ -55,8 +57,10 @@ export default {
|
||||
return
|
||||
}
|
||||
try {
|
||||
const res = await axios.get('/v2/getFileList', { params: { url: this.url } })
|
||||
this.directoryData = res.data.data || []
|
||||
const res = await axios.get('/v2/getFileListPage', { params: { url: this.url } })
|
||||
const page = res.data.data || {}
|
||||
this.pageInfo = Array.isArray(page) ? null : page
|
||||
this.directoryData = Array.isArray(page) ? page : (page.list || [])
|
||||
} catch (e) {
|
||||
this.error = e.response?.data?.msg || e.response?.data?.error || '目录解析失败'
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user