transferLocal.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <style scoped>
  2. .bounce {
  3. display: flex;
  4. align-items: center;
  5. justify-content: center;
  6. width: 100%;
  7. color: black;
  8. height: 100%;
  9. font: normal bold 2rem 'Product Sans', sans-serif;
  10. white-space: nowrap;
  11. }
  12. .letter {
  13. animation: bounce 0.75s cubic-bezier(0.05, 0, 0.2, 1) infinite alternate;
  14. display: inline-block;
  15. transform: translate3d(0, 0, 0);
  16. margin-top: 0.5em;
  17. text-shadow: rgba(255, 255, 255, 0.4) 0 0 0.05em;
  18. font: normal 500 2rem 'Varela Round', sans-serif;
  19. }
  20. .letter:nth-child(1) {
  21. animation-delay: 0s;
  22. }
  23. .letter:nth-child(2) {
  24. animation-delay: 0.1s;
  25. }
  26. .letter:nth-child(3) {
  27. animation-delay: 0.2s;
  28. }
  29. .letter:nth-child(4) {
  30. animation-delay: 0.3s;
  31. }
  32. .letter:nth-child(5) {
  33. animation-delay: 0.4s;
  34. }
  35. .letter:nth-child(6) {
  36. animation-delay: 0.5s;
  37. }
  38. .letter:nth-child(7) {
  39. animation-delay: 0.6s;
  40. }
  41. .letter:nth-child(8) {
  42. animation-delay: 0.7s;
  43. }
  44. .letter:nth-child(9) {
  45. animation-delay: 0.8s;
  46. }
  47. .letter:nth-child(10) {
  48. animation-delay: 0.9s;
  49. }
  50. @keyframes bounce {
  51. 0% {
  52. transform: translate3d(0, 0, 0);
  53. text-shadow: rgba(255, 255, 255, 0.4) 0 0 0.05em;
  54. }
  55. 100% {
  56. transform: translate3d(0, -1em, 0);
  57. text-shadow: rgba(255, 255, 255, 0.4) 0 1em 0.35em;
  58. }
  59. }
  60. </style>
  61. <template>
  62. <div style="margin:100px 0">
  63. <div style="text-align:center;width:300%;margin-left:-100%;font-size:30px" class="bounce">
  64. <span class="letter">企</span>
  65. <span class="letter">业</span>
  66. <span class="letter">微</span>
  67. <span class="letter">信</span>
  68. <span class="letter">登</span>
  69. <span class="letter">录</span>
  70. <span class="letter">中</span>
  71. ,
  72. <span class="letter">请</span>
  73. <span class="letter">稍</span>
  74. <span class="letter">候</span>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import { postAction } from '@/api/manage'
  80. import { mapActions } from 'vuex'
  81. import { timeFix } from '@/utils/util'
  82. import qs from 'qs'
  83. import Vue from 'vue'
  84. export default {
  85. name: 'transfer',
  86. components: {},
  87. data() {
  88. return {}
  89. },
  90. methods: {
  91. ...mapActions(['Login', 'Logout', 'PhoneLogin', 'wxLogin']),
  92. login(values) {
  93. this.wxLogin(values)
  94. this.loginSuccess()
  95. },
  96. departConfirm(res) {
  97. if (res.success) {
  98. let multi_depart = res.result.multi_depart
  99. //0:无部门 1:一个部门 2:多个部门
  100. if (multi_depart == 0) {
  101. this.loginSuccess()
  102. this.$notification.warn({
  103. message: '提示',
  104. description: `您尚未归属部门,请确认账号信息`,
  105. duration: 3
  106. })
  107. } else if (multi_depart == 2) {
  108. this.departVisible = true
  109. this.currentUsername = this.form.getFieldValue('username')
  110. this.departList = res.result.departs
  111. } else {
  112. this.loginSuccess()
  113. }
  114. } else {
  115. this.requestFailed(res)
  116. this.Logout()
  117. }
  118. },
  119. requestFailed(err) {
  120. this.$notification['error']({
  121. message: '登录失败',
  122. description: ((err.response || {}).data || {}).message || err.message || '请求出现错误,请稍后再试',
  123. duration: 4
  124. })
  125. this.loginBtn = false
  126. },
  127. loginSuccess() {
  128. this.$router.push({ name: 'dashboard' })
  129. this.$notification.success({
  130. message: '欢迎',
  131. description: `${timeFix()},欢迎回来`
  132. })
  133. }
  134. },
  135. mounted() {
  136. this.$nextTick(() => {
  137. console.log(window.location.search)
  138. var data = window.location.search.split('?')[1]
  139. var arr = data.split('=')
  140. var json = {}
  141. json[arr[0]] = arr[1]
  142. var params = qs.stringify(json)
  143. postAction('/sys/wxlogin', params).then(res => {
  144. console.log(res)
  145. if (res.success) {
  146. this.login(res)
  147. } else {
  148. // this.$message.error('企业微信登录失败,请选择账户登录')
  149. this.requestFailed(res)
  150. this.$router.push({ name: 'login' })
  151. }
  152. })
  153. })
  154. }
  155. }
  156. </script>
  157. <style scoped></style>