<template>
  <div class="download">
    <p v-if="isWx">请点击右上方 . . . </p>
    <p v-if="isWx">使用默认浏览器打开</p>
  </div>
</template>

<script>
export default {
  name: 'Download',
  data() {
    return {
      isWx: window.os.isWx
    }
  },
  mounted() {
    // 如果在微信中，则不处理
    if (this.isWx) {
      return
    }
    // 开始获取当前url
    const { url } = this.$route.query
    // 直接下载
    window.location.href = decodeURIComponent(url)
  }
}
</script>

<style lang="scss" scoped>
.download {
  align-items: center;
  display: flex;
  font-size: 42px;
  flex-direction: column;
  justify-content: center;
  height: 100vh;
  p {
    margin: 20px 0;
  }
}
</style>
