mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 17:02:47 +00:00
repair upload file bug in shared uploaded link
This commit is contained in:
@@ -27,6 +27,7 @@ const propTypes = {
|
||||
fileTypeErrorCallback: PropTypes.func,
|
||||
dragAndDrop: PropTypes.bool.isRequired,
|
||||
path: PropTypes.string.isRequired,
|
||||
uploadUrlPath: PropTypes.string.isRequired,
|
||||
onFileUploadSuccess: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
@@ -203,8 +204,8 @@ class FileUploader extends React.Component {
|
||||
});
|
||||
} else {
|
||||
this.setUploadFileList(this.resumable.files);
|
||||
let { token } = this.props;
|
||||
seafileAPI.sharedLinkGetFileUploadUrl(token).then(res => {
|
||||
let { token, uploadUrlPath } = this.props;
|
||||
seafileAPI.sharedLinkGetFileUploadUrl(token, uploadUrlPath).then(res => {
|
||||
this.resumable.opts.target = res.data.upload_link + '?ret-json=1';
|
||||
this.resumableUpload(resumableFile);
|
||||
}).catch(error => {
|
||||
@@ -216,8 +217,8 @@ class FileUploader extends React.Component {
|
||||
this.setUploadFileList(this.resumable.files);
|
||||
if (!this.isUploadLinkLoaded) {
|
||||
this.isUploadLinkLoaded = true;
|
||||
let { token } = this.props;
|
||||
seafileAPI.sharedLinkGetFileUploadUrl(token).then(res => {
|
||||
let { token, uploadUrlPath } = this.props;
|
||||
seafileAPI.sharedLinkGetFileUploadUrl(token, uploadUrlPath).then(res => {
|
||||
this.resumable.opts.target = res.data.upload_link + '?ret-json=1';
|
||||
this.resumable.upload();
|
||||
}).catch(error => {
|
||||
@@ -563,8 +564,8 @@ class FileUploader extends React.Component {
|
||||
|
||||
onUploadRetry = (resumableFile) => {
|
||||
|
||||
let { token } = this.props;
|
||||
seafileAPI.sharedLinkGetFileUploadUrl(token).then(res => {
|
||||
let { token, uploadUrlPath } = this.props;
|
||||
seafileAPI.sharedLinkGetFileUploadUrl(token, uploadUrlPath).then(res => {
|
||||
this.resumable.opts.target = res.data.upload_link + '?ret-json=1';
|
||||
|
||||
let retryFileList = this.state.retryFileList.filter(item => {
|
||||
@@ -590,8 +591,8 @@ class FileUploader extends React.Component {
|
||||
|
||||
onUploadRetryAll = () => {
|
||||
|
||||
let { token } = this.props;
|
||||
seafileAPI.sharedLinkGetFileUploadUrl(token).then(res => {
|
||||
let { token, uploadUrlPath } = this.props;
|
||||
seafileAPI.sharedLinkGetFileUploadUrl(token, uploadUrlPath).then(res => {
|
||||
this.resumable.opts.target = res.data.upload_link + '?ret-json=1';
|
||||
this.state.retryFileList.forEach(item => {
|
||||
item.error = false;
|
||||
@@ -644,8 +645,8 @@ class FileUploader extends React.Component {
|
||||
uploadFile = () => {
|
||||
let resumableFile = this.resumable.files[this.resumable.files.length - 1];
|
||||
|
||||
let { token } = this.props;
|
||||
seafileAPI.sharedLinkGetFileUploadUrl(token).then(res => {
|
||||
let { token, uploadUrlPath } = this.props;
|
||||
seafileAPI.sharedLinkGetFileUploadUrl(token, uploadUrlPath).then(res => {
|
||||
this.resumable.opts.target = res.data.upload_link + '?ret-json=1';
|
||||
this.setState({
|
||||
isUploadRemindDialogShow: false,
|
||||
|
Reference in New Issue
Block a user