exit.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view>
  3. <scroll-view :scroll-y="modalName==null" class="page" :class="modalName!=null?'show':''">
  4. <cu-custom bgColor="bg-gradual-pink" :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 { ACCESS_TOKEN,USER_NAME,USER_INFO } from "@/common/util/constants"
  26. export default {
  27. data() {
  28. return {
  29. modalName: null,
  30. item:{msg:'退出成功'},
  31. }
  32. },
  33. onLoad: function (option) {
  34. let para={access_token:uni.getStorageSync(ACCESS_TOKEN) }
  35. let url="/ibps/oauth2/v3/user/logout?access_token="+uni.getStorageSync(ACCESS_TOKEN)
  36. api.logout(url,para).then(res=>{
  37. uni.clearStorageSync()
  38. //ibps/oauth2/v3/user/logout?access_token=
  39. })
  40. },
  41. methods: {
  42. goback(){
  43. uni.navigateTo({
  44. url:'/pages/login/login'
  45. })
  46. }
  47. }
  48. }
  49. </script>
  50. <style>
  51. </style>