mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 07:41:26 +00:00
update seafile-js api (#4405)
This commit is contained in:
@@ -38,7 +38,7 @@ class GenerateUploadLink extends React.Component {
|
||||
getUploadLink = () => {
|
||||
let path = this.props.itemPath;
|
||||
let repoID = this.props.repoID;
|
||||
seafileAPI.getUploadLinks(repoID, path).then((res) => {
|
||||
seafileAPI.getUploadLink(repoID, path).then((res) => {
|
||||
if (res.data.length !== 0) {
|
||||
let sharedUploadInfo = new UploadLink(res.data[0]);
|
||||
this.setState({sharedUploadInfo: sharedUploadInfo});
|
||||
|
@@ -195,7 +195,7 @@ class FileUploader extends React.Component {
|
||||
} else {
|
||||
this.setUploadFileList(this.resumable.files);
|
||||
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.resumableUpload(resumableFile);
|
||||
}).catch(error => {
|
||||
@@ -208,7 +208,7 @@ class FileUploader extends React.Component {
|
||||
if (!this.isUploadLinkLoaded) {
|
||||
this.isUploadLinkLoaded = true;
|
||||
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.upload();
|
||||
}).catch(error => {
|
||||
@@ -548,7 +548,7 @@ class FileUploader extends React.Component {
|
||||
|
||||
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';
|
||||
|
||||
let retryFileList = this.state.retryFileList.filter(item => {
|
||||
@@ -574,7 +574,7 @@ class FileUploader extends React.Component {
|
||||
|
||||
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.state.retryFileList.forEach(item => {
|
||||
item.error = false;
|
||||
@@ -645,7 +645,7 @@ class FileUploader extends React.Component {
|
||||
uploadFile = () => {
|
||||
let resumableFile = this.resumable.files[this.resumable.files.length - 1];
|
||||
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.setState({
|
||||
isUploadRemindDialogShow: false,
|
||||
|
@@ -80,7 +80,7 @@ class EditorUtilities {
|
||||
|
||||
uploadLocalImage = (imageFile) => {
|
||||
return (
|
||||
seafileAPI.getUploadLink(repoID, dirPath).then((res) => {
|
||||
seafileAPI.getFileServerUploadLink(repoID, dirPath).then((res) => {
|
||||
const uploadLink = res.data + '?ret-json=1';
|
||||
const name = getImageFileNameWithTimestamp();
|
||||
const newFile = new File([imageFile], name, {type: imageFile.type});
|
||||
|
@@ -353,7 +353,7 @@ class ShareAdminShareLinks extends Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
seafileAPI.listShareLinks().then((res) => {
|
||||
seafileAPI.listUserShareLinks().then((res) => {
|
||||
let items = res.data.map(item => {
|
||||
return new ShareLink(item);
|
||||
});
|
||||
|
@@ -199,7 +199,7 @@ class ShareAdminUploadLinks extends Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
seafileAPI.listUploadLinks().then((res) => {
|
||||
seafileAPI.listUserUploadLinks().then((res) => {
|
||||
let items = res.data.map(item => {
|
||||
return new UploadLink(item);
|
||||
});
|
||||
|
Reference in New Issue
Block a user