index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="lli-develop-expect-page">
  3. <button class="lli-btn" @click="quit">退出登录</button>
  4. </view>
  5. </template>
  6. <script setup>
  7. import {
  8. logout
  9. } from '@/api/login.js'
  10. const quitClick = ()=>{
  11. uni.showModal({
  12. title: '提示',
  13. content: '你确定要执行这个操作吗?',
  14. success: (res) => {
  15. if (res.confirm) {
  16. // 用户点击了确定按钮,执行你的操作
  17. console.log('用户点击了确定');
  18. quit()
  19. } else if (res.cancel) {
  20. // 用户点击了取消按钮
  21. console.log('用户点击了取消');
  22. }
  23. }
  24. });
  25. }
  26. const quit = ()=>{
  27. logout().then(res=>{
  28. uni.removeStorage({
  29. key: 'Mta-Auth',
  30. success: function (res) {
  31. console.log('success');
  32. uni.navigateTo({
  33. url: '/pages/login'
  34. });
  35. }
  36. });
  37. })
  38. }
  39. // import { ref, onMounted } from 'vue';
  40. //
  41. // const listData = ref([]);
  42. // const page = ref(1);
  43. // const pageSize = ref(10);
  44. // const isLoading = ref(false);
  45. // const noMoreData = ref(false);
  46. //
  47. // // 加载
  48. // const loadData = async () => {
  49. // if (isLoading.value || noMoreData.value) return;
  50. // isLoading.value = true;
  51. // const newData = await fetchData(page.value, pageSize.value); // 假设 fetchData 是你的请求函数
  52. // if (newData.length > 0) {
  53. // listData.value = listData.value.concat(newData);
  54. // page.value++;
  55. // } else {
  56. // noMoreData.value = true;
  57. // }
  58. // isLoading.value = false;
  59. // };
  60. // onMounted(() => {
  61. // loadData();
  62. // });
  63. //
  64. // // 下拉加载更多
  65. // const loadMore = () => {
  66. // loadData();
  67. // };
  68. </script>
  69. <style>
  70. </style>