diff --git a/frontend/src/components/dir-view/dir-view.js b/frontend/src/components/dir-view/dir-view.js index 2693c2a201..62154e28f9 100644 --- a/frontend/src/components/dir-view/dir-view.js +++ b/frontend/src/components/dir-view/dir-view.js @@ -44,7 +44,7 @@ class DirView extends React.Component { } componentDidMount() { - //eg: http://127.0.0.1:8000/library/repo_id/repo_name/**/**/\ + // eg: http://127.0.0.1:8000/library/repo_id/repo_name/**/**/\ let location = decodeURIComponent(window.location.href); let repoID = this.props.repoID; seafileAPI.getRepoInfo(repoID).then(res => { @@ -66,8 +66,7 @@ class DirView extends React.Component { updateDirentList = (filePath) => { let repoID = this.state.repoID; this.setState({isDirentListLoading: true}); - const path = Utils.encodePath(filePath); - seafileAPI.listDir(repoID, path).then(res => { + seafileAPI.listDir(repoID, filePath).then(res => { let direntList = res.data.map(item => { return new Dirent(item); }); diff --git a/frontend/src/repo-wiki-mode.js b/frontend/src/repo-wiki-mode.js index 51af15fa1a..1a296b5b66 100644 --- a/frontend/src/repo-wiki-mode.js +++ b/frontend/src/repo-wiki-mode.js @@ -247,8 +247,7 @@ class Wiki extends Component { loadDirentList = (filePath) => { this.setState({isDirentListLoading: true}); - const path = encodeURIComponent(filePath); - seafileAPI.listDir(repoID, path).then(res => { + seafileAPI.listDir(repoID, filePath).then(res => { let direntList = []; res.data.forEach(item => { let dirent = new Dirent(item);