2021-08-12 22:30:17 +00:00
|
|
|
export default async function() {
|
2021-08-12 22:41:23 +00:00
|
|
|
const { store } = this.context
|
2021-08-12 22:30:17 +00:00
|
|
|
|
|
|
|
try {
|
2021-08-12 22:41:23 +00:00
|
|
|
const response = await this.callApi('/api/userinfo')
|
2021-08-12 22:30:17 +00:00
|
|
|
store.commit('engine/setUser', response.data)
|
|
|
|
} catch(e) {
|
|
|
|
store.commit('engine/setUser', undefined)
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
return true
|
|
|
|
}
|