1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

redirect client's view lib url to library content pages's url

This commit is contained in:
LeoSirius
2019-06-27 17:53:36 +08:00
parent 9185d675bd
commit 5d2421bc68
3 changed files with 15 additions and 1 deletions

View File

@@ -75,7 +75,20 @@ class App extends Component {
}
}
navigateClientUrlToLib = () =>{
if(window.location.hash){
let splitUrlArray = window.location.hash.split('/');
let repoID = splitUrlArray[splitUrlArray.length-2];
let url = siteRoot + 'library/' + repoID + '/';
navigate(url, {repalce: true});
}
}
componentDidMount() {
// url from client e.g. http://127.0.0.1:8000/#common/lib/34e7fb92-e91d-499d-bcde-c30ea8af9828/
// navigate to library page http://127.0.0.1:8000/library/34e7fb92-e91d-499d-bcde-c30ea8af9828/
this.navigateClientUrlToLib();
// e.g. from http://127.0.0.1:8000/drafts/reviews/
// get reviews
// TODO: need refactor later