Fix cookie paths
parent
915eb68954
commit
2936858adb
|
@ -214,8 +214,10 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
document.cookie = `sort=${sort}; max-age=31536000; path=${this.$store.state.baseURL}`
|
||||
document.cookie = `order=${order}; max-age=31536000; path=${this.$store.state.baseURL}`
|
||||
let path = this.$store.state.baseURL
|
||||
if (path === '') path = '/'
|
||||
document.cookie = `sort=${sort}; max-age=31536000; path=${path}`
|
||||
document.cookie = `order=${order}; max-age=31536000; path=${path}`
|
||||
this.$store.commit('setReload', true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,9 @@ export default {
|
|||
}
|
||||
|
||||
this.$store.commit('listingDisplay', display)
|
||||
document.cookie = `display=${display}; max-age=31536000; path=${this.$store.state.baseURL}`
|
||||
let path = this.$store.state.baseURL
|
||||
if (path === '') path = '/'
|
||||
document.cookie = `display=${display}; max-age=31536000; path=${path}`
|
||||
},
|
||||
icon: function () {
|
||||
if (this.$store.state.req.display === 'mosaic') return 'view_list'
|
||||
|
|
|
@ -3,7 +3,9 @@ import store from '@/store'
|
|||
import router from '@/router'
|
||||
|
||||
function parseToken (token) {
|
||||
document.cookie = `auth=${token}; max-age=86400; path=${store.state.baseURL}`
|
||||
let path = store.state.baseURL
|
||||
if (path === '') path = '/'
|
||||
document.cookie = `auth=${token}; max-age=86400; path=${path}`
|
||||
let res = token.split('.')
|
||||
let user = JSON.parse(window.atob(res[1]))
|
||||
store.commit('setJWT', token)
|
||||
|
@ -49,7 +51,9 @@ function login (user, password) {
|
|||
}
|
||||
|
||||
function logout () {
|
||||
document.cookie = `auth='nothing'; max-age=0; path=${store.state.baseURL}`
|
||||
let path = store.state.baseURL
|
||||
if (path === '') path = '/'
|
||||
document.cookie = `auth='nothing'; max-age=0; path=${path}`
|
||||
router.push({path: '/login'})
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
2318
rice-box.go
2318
rice-box.go
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue