mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 18:03:48 +00:00
@@ -39,7 +39,7 @@ class GenerateUploadLink extends React.Component {
|
|||||||
getUploadLink = () => {
|
getUploadLink = () => {
|
||||||
let path = this.props.itemPath;
|
let path = this.props.itemPath;
|
||||||
let repoID = this.props.repoID;
|
let repoID = this.props.repoID;
|
||||||
seafileAPI.getUploadLinks(repoID, path).then((res) => {
|
seafileAPI.getUploadLink(repoID, path).then((res) => {
|
||||||
if (res.data.length !== 0) {
|
if (res.data.length !== 0) {
|
||||||
let sharedUploadInfo = new UploadLink(res.data[0]);
|
let sharedUploadInfo = new UploadLink(res.data[0]);
|
||||||
this.setState({sharedUploadInfo: sharedUploadInfo});
|
this.setState({sharedUploadInfo: sharedUploadInfo});
|
||||||
|
@@ -200,7 +200,7 @@ class FileUploader extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
this.setUploadFileList(this.resumable.files);
|
this.setUploadFileList(this.resumable.files);
|
||||||
let { repoID, path } = this.props;
|
let { repoID, path } = this.props;
|
||||||
seafileAPI.getUploadLink(repoID, path).then(res => {
|
seafileAPI.getFileServerUploadLink(repoID, path).then(res => {
|
||||||
this.resumable.opts.target = res.data + '?ret-json=1';
|
this.resumable.opts.target = res.data + '?ret-json=1';
|
||||||
this.resumableUpload(resumableFile);
|
this.resumableUpload(resumableFile);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
@@ -213,7 +213,7 @@ class FileUploader extends React.Component {
|
|||||||
if (!this.isUploadLinkLoaded) {
|
if (!this.isUploadLinkLoaded) {
|
||||||
this.isUploadLinkLoaded = true;
|
this.isUploadLinkLoaded = true;
|
||||||
let { repoID, path } = this.props;
|
let { repoID, path } = this.props;
|
||||||
seafileAPI.getUploadLink(repoID, path).then(res => {
|
seafileAPI.getFileServerUploadLink(repoID, path).then(res => {
|
||||||
this.resumable.opts.target = res.data + '?ret-json=1';
|
this.resumable.opts.target = res.data + '?ret-json=1';
|
||||||
this.resumable.upload();
|
this.resumable.upload();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
@@ -553,7 +553,7 @@ class FileUploader extends React.Component {
|
|||||||
|
|
||||||
onUploadRetry = (resumableFile) => {
|
onUploadRetry = (resumableFile) => {
|
||||||
|
|
||||||
seafileAPI.getUploadLink(this.props.repoID, this.props.path).then(res => {
|
seafileAPI.getFileServerUploadLink(this.props.repoID, this.props.path).then(res => {
|
||||||
this.resumable.opts.target = res.data + '?ret-json=1';
|
this.resumable.opts.target = res.data + '?ret-json=1';
|
||||||
|
|
||||||
let retryFileList = this.state.retryFileList.filter(item => {
|
let retryFileList = this.state.retryFileList.filter(item => {
|
||||||
@@ -579,7 +579,7 @@ class FileUploader extends React.Component {
|
|||||||
|
|
||||||
onUploadRetryAll = () => {
|
onUploadRetryAll = () => {
|
||||||
|
|
||||||
seafileAPI.getUploadLink(this.props.repoID, this.props.path).then(res => {
|
seafileAPI.getFileServerUploadLink(this.props.repoID, this.props.path).then(res => {
|
||||||
this.resumable.opts.target = res.data + '?ret-json=1';
|
this.resumable.opts.target = res.data + '?ret-json=1';
|
||||||
this.state.retryFileList.forEach(item => {
|
this.state.retryFileList.forEach(item => {
|
||||||
item.error = false;
|
item.error = false;
|
||||||
@@ -650,7 +650,7 @@ class FileUploader extends React.Component {
|
|||||||
uploadFile = () => {
|
uploadFile = () => {
|
||||||
let resumableFile = this.resumable.files[this.resumable.files.length - 1];
|
let resumableFile = this.resumable.files[this.resumable.files.length - 1];
|
||||||
let { repoID, path } = this.props;
|
let { repoID, path } = this.props;
|
||||||
seafileAPI.getUploadLink(repoID, path).then((res) => { // get upload link
|
seafileAPI.getFileServerUploadLink(repoID, path).then((res) => { // get upload link
|
||||||
this.resumable.opts.target = res.data + '?ret-json=1';
|
this.resumable.opts.target = res.data + '?ret-json=1';
|
||||||
this.setState({
|
this.setState({
|
||||||
isUploadRemindDialogShow: false,
|
isUploadRemindDialogShow: false,
|
||||||
|
@@ -79,7 +79,7 @@ class EditorUtilities {
|
|||||||
|
|
||||||
uploadImage = (imageFile) => {
|
uploadImage = (imageFile) => {
|
||||||
return (
|
return (
|
||||||
seafileAPI.getUploadLink(repoID, dirPath).then((res) => {
|
seafileAPI.getFileServerUploadLink(repoID, dirPath).then((res) => {
|
||||||
let uploadLinkComponent = res.data;
|
let uploadLinkComponent = res.data;
|
||||||
const uploadLink = uploadLinkComponent + '?ret-json=1';
|
const uploadLink = uploadLinkComponent + '?ret-json=1';
|
||||||
const name = getImageFileNameWithTimestamp();
|
const name = getImageFileNameWithTimestamp();
|
||||||
@@ -102,7 +102,7 @@ class EditorUtilities {
|
|||||||
|
|
||||||
uploadLocalImage = (imageFile) => {
|
uploadLocalImage = (imageFile) => {
|
||||||
return (
|
return (
|
||||||
seafileAPI.getUploadLink(repoID, dirPath).then((res) => {
|
seafileAPI.getFileServerUploadLink(repoID, dirPath).then((res) => {
|
||||||
const uploadLink = res.data + '?ret-json=1';
|
const uploadLink = res.data + '?ret-json=1';
|
||||||
const newFile = new File([imageFile], imageFile.name, {type: imageFile.type});
|
const newFile = new File([imageFile], imageFile.name, {type: imageFile.type});
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
@@ -367,7 +367,7 @@ class ShareAdminShareLinks extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
seafileAPI.listShareLinks().then((res) => {
|
seafileAPI.listUserShareLinks().then((res) => {
|
||||||
let items = res.data.map(item => {
|
let items = res.data.map(item => {
|
||||||
return new ShareLink(item);
|
return new ShareLink(item);
|
||||||
});
|
});
|
||||||
|
@@ -199,7 +199,7 @@ class ShareAdminUploadLinks extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
seafileAPI.listUploadLinks().then((res) => {
|
seafileAPI.listUserUploadLinks().then((res) => {
|
||||||
let items = res.data.map(item => {
|
let items = res.data.map(item => {
|
||||||
return new UploadLink(item);
|
return new UploadLink(item);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user