mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-10 11:21:29 +00:00
file-download-url-update (#6804)
This commit is contained in:
@@ -269,7 +269,7 @@ class DirColumnNav extends React.Component {
|
||||
'src': src,
|
||||
'thumbnail': `${siteRoot}thumbnail/${repoID}/${thumbnailSizeForOriginal}${path}`,
|
||||
'node': items.find(item => item.path.split('/').pop() === name),
|
||||
'downloadURL': `${fileServerRoot}repos/${repoID}/files/?op=download&p=${path}`,
|
||||
'downloadURL': `${fileServerRoot}repos/${repoID}/files${path}/?op=download`,
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -591,7 +591,7 @@ class DirentGridView extends React.Component {
|
||||
'url': `${siteRoot}lib/${repoID}/file${path}`,
|
||||
'thumbnail': `${siteRoot}thumbnail/${repoID}/${thumbnailSizeForOriginal}${path}`,
|
||||
'src': `${siteRoot}repo/${repoID}/raw${path}?t=${cacheBuster}`,
|
||||
'downloadURL': `${fileServerRoot}repos/${repoID}/files/?op=download&p=${path}`,
|
||||
'downloadURL': `${fileServerRoot}repos/${repoID}/files${path}?op=download`,
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -189,7 +189,7 @@ class DirentListView extends React.Component {
|
||||
'url': `${siteRoot}lib/${repoID}/file${path}`,
|
||||
'thumbnail': `${siteRoot}thumbnail/${repoID}/${thumbnailSizeForOriginal}${path}`,
|
||||
'src': `${siteRoot}repo/${repoID}/raw${path}`,
|
||||
'downloadURL': `${fileServerRoot}repos/${repoID}/files/?op=download&p=${path}`,
|
||||
'downloadURL': `${fileServerRoot}repos/${repoID}/files${path}/?op=download`,
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -29,7 +29,7 @@ const FileNameEditor = ({ column, record, table, onCommitCancel }) => {
|
||||
url: `${siteRoot}lib/${repoID}/file${path}`,
|
||||
thumbnail: `${siteRoot}thumbnail/${repoID}/${thumbnailSizeForOriginal}${path}`,
|
||||
src: src,
|
||||
downloadURL: `${fileServerRoot}repos/${repoID}/files/?op=download&p=${path}`,
|
||||
downloadURL: `${fileServerRoot}repos/${repoID}/files${path}/?op=download`,
|
||||
};
|
||||
});
|
||||
}, [table]);
|
||||
|
@@ -11,7 +11,7 @@ class URLDecorator {
|
||||
url = siteRoot + 'repo/' + historyRepoID + '/' + options.objID + '/download?' + params;
|
||||
break;
|
||||
case 'download_file_url':
|
||||
url = fileServerRoot + 'repos/' + options.repoID + '/files/?p=' + options.filePath + '&op=download';
|
||||
url = fileServerRoot + 'repos/' + options.repoID + '/files/' + Utils.encodePath(options.filePath) + '/?op=download';
|
||||
break;
|
||||
case 'file_revisions':
|
||||
params = 'p=' + Utils.encodePath(options.filePath);
|
||||
|
@@ -546,10 +546,10 @@ def gen_file_get_url_by_sharelink(token):
|
||||
def gen_file_get_url_new(repo_id, filepath, op='download'):
|
||||
"""
|
||||
Generate fileserver file url.
|
||||
Format: http://<domain:port>/repos/<repo_id>files/?p=<filepath>&op=download
|
||||
Format: http://<domain:port>/repos/<repo_id>files/<filepath>/?op=download
|
||||
"""
|
||||
|
||||
return '%s/repos/%s/files/?p=%s&op=%s' % (
|
||||
return '%s/repos/%s/files/%s/?op=%s' % (
|
||||
get_fileserver_root(),
|
||||
repo_id,
|
||||
quote(filepath.strip('/')),
|
||||
|
Reference in New Issue
Block a user