<template>
  <div class="login">
    <!-- <h1 class="title">{{ $t('main.title') }}</h1> -->
    <img class="logo-title" src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/highway/h5/login_logo.png" />
    <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() {
      const url = document.referrer
      const index = url.lastIndexOf('/')
      window.location.href = url.substring(0, index)
    }
  }
}
</script>

<style lang="scss" scoped>
:deep() {
  .el-button--primary {
    // --main-color: #1655b2 !important;
    background-color: #1655b2;
    border-color: #1655b2;
  }
}
.footer {
  margin-top: 30px;
  clear: both;
  color: #000;
  line-height: 52px;
  cursor: pointer;
}
.logo-title {
  width: 80%;
  margin: 60px auto;
  display: block;
}
</style>
