me page update

This commit is contained in:
leejinseok
2020-02-14 16:38:27 +09:00
parent 68d7abb776
commit edb911d6d7

View File

@@ -20,7 +20,7 @@
</template>
<script>
import authApi from "../../api/authApi";
import authService from "../../services/authService";
export default {
name: "Info",
@@ -31,10 +31,14 @@
};
},
async beforeCreate() {
authApi.bind(this);
authService.session = authService.session.bind(this);
authService.banishIfUserUnAuthenticated = authService.banishIfUserUnAuthenticated.bind(this);
},
async created() {
await authService.banishIfUserUnAuthenticated();
try {
const {data} = await authApi.session();
const {data} = await authService.session();
this.user = data;
} catch (err) {
await this.$router.replace("/auth/login");