1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 07:55:36 +00:00

[shared dir view] added 'download selected items' (#4535)

This commit is contained in:
llj
2020-04-18 18:10:53 +08:00
committed by GitHub
parent 9acfef9fc8
commit 91e45db4d9
2 changed files with 87 additions and 9 deletions

View File

@@ -31,9 +31,14 @@ class ZipDownloadDialog extends React.Component {
componentDidMount() {
const { token, path, repoID, target } = this.props;
const getZipTask = token ?
seafileAPI.getShareLinkZipTask(token, path) :
seafileAPI.zipDownload(repoID, path, target);
let getZipTask;
if (token) {
getZipTask = target.length ?
seafileAPI.getShareLinkDirentsZipTask(token, path, target) :
seafileAPI.getShareLinkZipTask(token, path);
} else {
getZipTask = seafileAPI.zipDownload(repoID, path, target);
}
getZipTask.then((res) => {
const zipToken = res.data['zip_token'];
this.setState({