index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div class="logout">
  3. <loading/>
  4. <p>退出中,请稍后...</p>
  5. </div>
  6. </template>
  7. <script>
  8. import Loading from '~components/common/loading/Loading.vue'
  9. export default {
  10. name: 'logout',
  11. layout: 'mobile',
  12. components: {
  13. Loading
  14. },
  15. mounted () {
  16. this.$nextTick(() => {
  17. this.logquit()
  18. })
  19. },
  20. methods: {
  21. logquit () {
  22. this.$http.get('/sso/login/logout', {params: this.$route.query})
  23. .then(response => {
  24. if (response.data.success) {
  25. for (let i = 0; i < response.data.content.logoutUrls.length; i++) {
  26. if (response.data.content.logoutUrls[i]) {
  27. this.$jsonp(`${response.data.content.logoutUrls[i]}`, function (err) {
  28. if (err) throw err
  29. })
  30. }
  31. }
  32. setTimeout(function () {
  33. window.location.href = `${response.data.content.returnURL}`
  34. }, 1000)
  35. }
  36. })
  37. }
  38. }
  39. }
  40. </script>
  41. <style type="text/scss" lang="scss" scoped>
  42. .logout{
  43. p{
  44. position: fixed;
  45. left: 0;
  46. right:0;
  47. top: 54%;
  48. z-index: 1000;
  49. text-align: center;
  50. font-size: 14px;
  51. color:#333;
  52. }
  53. }
  54. </style>