Loading.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div class="lottie-bg">
  3. <div id="lottie">
  4. <img
  5. src="@assets/images/live-logo.gif"
  6. rel="preload"
  7. style="width: 100%;"
  8. />
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. import { auth } from "@libs/wechat";
  14. export default {
  15. name: "Loading",
  16. mounted() {
  17. const { code, state } = this.$route.query;
  18. auth(code, state)
  19. .then(() => {
  20. // location.replace(
  21. // decodeURIComponent(decodeURIComponent(this.$route.params.url))
  22. // );
  23. location.href = decodeURIComponent(
  24. decodeURIComponent(this.$route.params.url)
  25. );
  26. })
  27. .catch(() => {
  28. location.replace("/");
  29. });
  30. }
  31. };
  32. </script>
  33. <style scoped>
  34. .lottie-bg {
  35. position: fixed;
  36. left: 0;
  37. top: 0;
  38. background-color: #fff;
  39. width: 100%;
  40. height: 100%;
  41. z-index: 999;
  42. display: -webkit-flex;
  43. display: flex;
  44. -webkit-align-items: center;
  45. align-items: center;
  46. -webkit-justify-content: center;
  47. justify-content: center;
  48. }
  49. #lottie {
  50. width: 35%;
  51. display: block;
  52. overflow: hidden;
  53. transform: translate3d(0, 0, 0);
  54. margin: auto;
  55. }
  56. </style>