mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 01:41:39 +00:00
update seafile-js api (#4405)
This commit is contained in:
6
frontend/package-lock.json
generated
6
frontend/package-lock.json
generated
@@ -11454,9 +11454,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"seafile-js": {
|
"seafile-js": {
|
||||||
"version": "0.2.141",
|
"version": "0.2.142",
|
||||||
"resolved": "https://registry.npmjs.org/seafile-js/-/seafile-js-0.2.141.tgz",
|
"resolved": "https://registry.npmjs.org/seafile-js/-/seafile-js-0.2.142.tgz",
|
||||||
"integrity": "sha512-qSymTCX4FUOL5fwzjOSwx8GCfJF/DuLsqx8CtrD/tdK/KJzVYf0gN/nI8lKFhU8mHYxvbZYv4CDC2YHp2dSEpg==",
|
"integrity": "sha512-OWSsx6tjMX3INpEm7xhC8f0KLRKi0VQqYnblgXX22BVrOqUCVNEqajHhjhYboqtkdIi3/S4Mi5SpBo1XR/UTwg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"axios": "^0.18.0",
|
"axios": "^0.18.0",
|
||||||
"form-data": "^2.3.2",
|
"form-data": "^2.3.2",
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
"react-responsive": "^6.1.2",
|
"react-responsive": "^6.1.2",
|
||||||
"react-select": "^2.4.1",
|
"react-select": "^2.4.1",
|
||||||
"reactstrap": "^6.4.0",
|
"reactstrap": "^6.4.0",
|
||||||
"seafile-js": "^0.2.141",
|
"seafile-js": "^0.2.142",
|
||||||
"socket.io-client": "^2.2.0",
|
"socket.io-client": "^2.2.0",
|
||||||
"sw-precache-webpack-plugin": "0.11.4",
|
"sw-precache-webpack-plugin": "0.11.4",
|
||||||
"unified": "^7.0.0",
|
"unified": "^7.0.0",
|
||||||
|
@@ -38,7 +38,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});
|
||||||
|
@@ -195,7 +195,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 => {
|
||||||
@@ -208,7 +208,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 => {
|
||||||
@@ -548,7 +548,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 => {
|
||||||
@@ -574,7 +574,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;
|
||||||
@@ -645,7 +645,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,
|
||||||
|
@@ -80,7 +80,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 name = getImageFileNameWithTimestamp();
|
const name = getImageFileNameWithTimestamp();
|
||||||
const newFile = new File([imageFile], name, {type: imageFile.type});
|
const newFile = new File([imageFile], name, {type: imageFile.type});
|
||||||
|
@@ -353,7 +353,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