<template>
  <div class="login">
    <h1 class="title">{{ $t('main.title') }}</h1>
    <div class="login-box">
      <router-view @success="handleSuccess"></router-view>
    </div>
    <p class="footer" @click="$router.push({ path: '../register', query: $route.query })">{{ $t('login.register') }}</p>
  </div>
</template>

<script>
export default {
  methods: {
    handleSuccess() {
      window.location.href = document.referrer
    }
  }
}
</script>

<style lang="scss" scoped>
.footer {
  margin-top: 30px;
  clear: both;
  color: #bb4767;
  line-height: 52px;
  cursor: pointer;
}
</style>
