Commit d8e3bbe7 authored by nano's avatar nano

fix

parent a93d5549
......@@ -188,17 +188,12 @@ export default {
setup({ dispatch, history }) {
let token = localStorage.getItem("token")
if(window.location.pathname != '/signin') {
return history.listen(({ pathname, query }) => {
if(pathname == '/' || pathname == 'profiles') {
dispatch({ type: 'preLogin', payload: { token } })
}
history.listen((a) => {
console.log(a)
})
return history.listen(({ pathname, query }) => {
console.log(pathname, query)
if(pathname == 'profiles' && !token) {
history.push("/signin")
}
......
......@@ -12,6 +12,7 @@ if (ssoString) {
export const handleSSO = (user) => {
if(sso) {
let params = new URLSearchParams()
let url = new URL(sso.get("return_sso_url"));
......@@ -28,4 +29,7 @@ export const handleSSO = (user) => {
window.location.href = url
return true
}else {
return false
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment