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

update seafile-js api (#4405)

This commit is contained in:
杨顺强
2020-01-11 13:29:04 +08:00
committed by Daniel Pan
parent 450b23d0d9
commit c3dff6225f
7 changed files with 13 additions and 13 deletions

View File

@@ -11454,9 +11454,9 @@
}
},
"seafile-js": {
"version": "0.2.141",
"resolved": "https://registry.npmjs.org/seafile-js/-/seafile-js-0.2.141.tgz",
"integrity": "sha512-qSymTCX4FUOL5fwzjOSwx8GCfJF/DuLsqx8CtrD/tdK/KJzVYf0gN/nI8lKFhU8mHYxvbZYv4CDC2YHp2dSEpg==",
"version": "0.2.142",
"resolved": "https://registry.npmjs.org/seafile-js/-/seafile-js-0.2.142.tgz",
"integrity": "sha512-OWSsx6tjMX3INpEm7xhC8f0KLRKi0VQqYnblgXX22BVrOqUCVNEqajHhjhYboqtkdIi3/S4Mi5SpBo1XR/UTwg==",
"requires": {
"axios": "^0.18.0",
"form-data": "^2.3.2",

View File

@@ -44,7 +44,7 @@
"react-responsive": "^6.1.2",
"react-select": "^2.4.1",
"reactstrap": "^6.4.0",
"seafile-js": "^0.2.141",
"seafile-js": "^0.2.142",
"socket.io-client": "^2.2.0",
"sw-precache-webpack-plugin": "0.11.4",
"unified": "^7.0.0",

View File

@@ -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});

View File

@@ -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,

View File

@@ -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});

View File

@@ -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);
});

View File

@@ -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);
});