| | |
| | | |
| | | if (window.electronAPI) { |
| | | window.electronAPI.onLogout((data) => { |
| | | localStorage.clear() |
| | | localStorage.removeItem("token") |
| | | localStorage.removeItem("userInfo") |
| | | router.replace({ |
| | | path: '/login' |
| | | }) |
| | |
| | | } |
| | | } |
| | | |
| | | let tokens = getUrlParam('token') |
| | | let bookId = getUrlParam('bookId') |
| | | let token = getUrlParam('token') |
| | | let tryPageCount = getUrlParam('tryPageCount') |
| | | localStorage.setItem('bookId', bookId) |
| | | localStorage.setItem('tryPageCount', tryPageCount) |
| | | const token = localStorage.getItem('token') || tokens |
| | | localStorage.setItem('token', token) |
| | | if (tokens && bookId) { |
| | | if(bookId){ |
| | | localStorage.setItem('bookId', bookId) |
| | | } |
| | | if(tryPageCount){ |
| | | localStorage.setItem('tryPageCount', tryPageCount) |
| | | } |
| | | |
| | | if(token && token != null && token != 'null'){ |
| | | localStorage.setItem('token', token) |
| | | } |
| | | if (bookId) { |
| | | router.replace({ |
| | | path: '/home', |
| | | query: { bookId: bookId } |
| | | }) |
| | | } else { |
| | | router.replace({ |
| | | path: '/login' |
| | | }) |
| | | } |
| | | </script> |