exit.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 store from '@/store/index.js'
  26. export default {
  27. data() {
  28. return {
  29. modalName: null,
  30. item:{msg:'退出成功'},
  31. }
  32. },
  33. onLoad: function (option) {
  34. api.logout().then(res=>{
  35. uni.clearStorageSync()
  36. store.commit('SET_TOKEN',"");
  37. })
  38. },
  39. methods: {
  40. goback(){
  41. /* window.location.reload() */
  42. uni.navigateTo({
  43. url:'/pages/login/login'
  44. })
  45. }
  46. }
  47. }
  48. </script>
  49. <style>
  50. </style>