14 lines
288 B
JavaScript
14 lines
288 B
JavaScript
|
export default async function() {
|
||
|
const { store, $axios } = this.context
|
||
|
|
||
|
try {
|
||
|
const response = await $axios.get('/api/userinfo')
|
||
|
store.commit('engine/setUser', response.data)
|
||
|
} catch(e) {
|
||
|
store.commit('engine/setUser', undefined)
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
return true
|
||
|
}
|