authLogin.vue 904 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <div class="welcome">
  3. <span class="text">Success</span>
  4. </div>
  5. </template>
  6. <script>
  7. import { setStorage, storageKey } from '../../utils/help';
  8. export default {
  9. name: 'authLogin',
  10. data() {
  11. return {
  12. code: '',
  13. };
  14. },
  15. methods: {
  16. close() {
  17. window.close();
  18. },
  19. },
  20. mounted() {
  21. let url = new URL(window.location.href);
  22. let search = url.search;
  23. let urlParams = new URLSearchParams(search);
  24. let verifier = urlParams.get('oauth_verifier');
  25. if (verifier) {
  26. setStorage(storageKey.verifier, verifier);
  27. let time = process.env.NODE_ENV === 'production' ? 200 : 500;
  28. setTimeout(() => {
  29. this.close();
  30. }, time);
  31. }
  32. },
  33. };
  34. </script>
  35. <style lang="scss" scoped>
  36. body {
  37. background-color: #f5f5f5;
  38. }
  39. .welcome {
  40. display: flex;
  41. align-items: center;
  42. justify-content: center;
  43. width: 100%;
  44. height: 100%;
  45. .text {
  46. font-size: 22px;
  47. color: #1d9bf0;
  48. }
  49. }
  50. </style>