Files
food-hub-ui/src/views/profile/index.vue
2025-06-27 17:08:52 +08:00

53 lines
1.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="common-mobile-view profile">
个人中心
<div>
<span>版本号</span>
<span>{{ appStore.version }}</span>
</div>
<div>
IOS下载地址<el-image :src="getAssetsImageFile('ios.png')"/>
</div>
<div>
Android下载地址
</div>
<div class="button-container">
<el-button type="primary" @click="viewLatestVersionClick">检查新版本</el-button>
<el-button type="primary" @click="logoutClick">退出登录</el-button>
</div>
</div>
</template>
<script setup lang="ts">
import { useAppStore } from '@/store/app.ts'
import { useUserStore } from '@/store/user.ts'
import { useAuthStore } from '@/store/auth.ts'
import { useRouter } from 'vue-router'
import { getAssetsImageFile } from '@/utils'
const appStore = useAppStore()
const userStore = useUserStore()
const authStore = useAuthStore()
const router = useRouter()
const viewLatestVersionClick = async () => {
await router.push('/')
location.reload()
}
const logoutClick = async () => {
await authStore.handleLogout(userStore.userInfo.username)
await router.push('/')
}
</script>
<style lang="scss">
.profile {
display: flex;
flex-direction: column;
gap: 10px;
}
</style>