setting.vue 644 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <fs-container>
  3. <template #default>
  4. <fs-cell-group arrow border gutter><fs-cell link="/pages/my/userInfo" title="个人信息"></fs-cell></fs-cell-group>
  5. </template>
  6. <template #footer>
  7. <view class="layout-box" v-if="token"><fs-button round full @click="handleLogout">退出登录</fs-button></view>
  8. </template>
  9. </fs-container>
  10. </template>
  11. <script setup>
  12. import { computed } from 'vue'
  13. import { useUserStore } from '@/stores/user'
  14. const user = useUserStore()
  15. const token = computed(() => user.token)
  16. const handleLogout = () => {
  17. user.logout().then(res => {
  18. console.log('logout')
  19. })
  20. }
  21. </script>
  22. <style></style>