exit.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view>
  3. <scroll-view :scroll-y="modalName==null" class="page" :class="modalName!=null?'show':''">
  4. <cu-custom bgColor="bg-luohu" :isBack="false">
  5. <!-- <block slot="backText">返回</block> -->
  6. <block slot="content">退出页</block>
  7. </cu-custom>
  8. <view class="solids-bottom padding-xs flex align-center">
  9. <view class="flex-sub text-center">
  10. <view class="solid-bottom text-xsl padding">
  11. <text class=" cuIcon-roundcheckfill text-green"></text>
  12. </view>
  13. <view class="padding">{{item.msg}}</view>
  14. </view>
  15. </view>
  16. <view class="padding flex flex-direction">
  17. <button class="cu-btn bg-green shadow-blur round lg" @tap="goback()">返回登录
  18. </button>
  19. </view>
  20. </scroll-view>
  21. </view>
  22. </template>
  23. <script>
  24. import api from "@/api/api";
  25. import {
  26. ACCESS_TOKEN,
  27. USER_NAME,
  28. USER_INFO
  29. } from "@/common/util/constants"
  30. export default {
  31. data() {
  32. return {
  33. modalName: null,
  34. item: {
  35. msg: '退出成功'
  36. },
  37. }
  38. },
  39. onLoad: function(option) {
  40. let loginMessage2 = uni.getStorageSync('login-message')
  41. let para = {
  42. access_token: uni.getStorageSync(ACCESS_TOKEN)
  43. }
  44. let url = "/ibps/oauth2/v3/user/logout?access_token=" + uni.getStorageSync(ACCESS_TOKEN)
  45. api.logout(url, para).then(res => {
  46. uni.clearStorageSync()
  47. //ibps/oauth2/v3/user/logout?access_token=
  48. uni.setStorageSync('login-message', loginMessage2)
  49. })
  50. },
  51. methods: {
  52. goback() {
  53. uni.navigateTo({
  54. url: '/pages/login/login'
  55. })
  56. }
  57. }
  58. }
  59. </script>
  60. <style>
  61. </style>