index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!-- @format -->
  2. <script lang="ts" setup>
  3. import { validateRegisterApi } from '~/api/model/user'
  4. const router = useRouter()
  5. const route = useRoute()
  6. const validate = ref(false)
  7. async function validateRegister() {
  8. try {
  9. const token = route.query.t
  10. await validateRegisterApi({ token })
  11. validate.value = true
  12. }
  13. catch (error) {
  14. validate.value = false
  15. console.log(error)
  16. }
  17. }
  18. validateRegister()
  19. function toHome() {
  20. router.push('/')
  21. }
  22. </script>
  23. <template>
  24. <div>
  25. <div
  26. v-if="validate"
  27. class="flex flex-col items-center justify-center h-full py-200px"
  28. >
  29. <img
  30. src="~/assets/images/register_success.png"
  31. class="w-120px h-120px"
  32. alt=""
  33. srcset=""
  34. >
  35. <div class="mt-20px mb-30px text-20px text-#333">
  36. Your account has been created successfully
  37. </div>
  38. <el-button class="!bg-#C58C64 !text-#fff !w-245px !h-50px !text-18px !fw-500 !b-rd-6px " @click="toHome">
  39. Start exploring
  40. </el-button>
  41. </div>
  42. <div v-else class="flex flex-col items-center justify-center h-full py-200px">
  43. <img
  44. src="~/assets/images/register_fail.png"
  45. class="w-120px h-120px"
  46. alt=""
  47. srcset=""
  48. >
  49. <div class="mt-20px text-20px text-#333">
  50. The email verfication link has been expired,please re-register later
  51. </div>
  52. </div>
  53. <common-footer-guide />
  54. </div>
  55. </template>
  56. <style lang="less" scoped></style>