This commit is contained in:
이진석
2020-02-05 16:49:56 +09:00
parent 8ac66c6e5a
commit 86d321737c

View File

@@ -22,31 +22,27 @@
<script>
import authApi from "../../api/authApi";
export default {
name: "Info",
data() {
return {
user: null,
init: false
}
},
async beforeCreate() {
authApi.bind(this);
export default {
name: "Info",
data() {
return {
user: null,
init: false
}
},
async beforeCreate() {
authApi.bind(this);
try {
const { data } = await authApi.session();
this.user = data;
} catch (err) {
console.log(err);
await this.$router.replace('/auth/login');
}
try {
const { data } = await authApi.session();
this.user = data;
} catch (err) {
await this.$router.replace('/auth/login');
}
}
}
}
</script>
<style scoped>
.row {
display: flex;
justify-content: space-between;
}
</style>