feat: 关于页面优化

This commit is contained in:
wangdan-fit2cloud 2024-03-21 16:33:13 +08:00
parent e5e68ed8a8
commit 389e620913
3 changed files with 7 additions and 4 deletions

View File

@ -128,7 +128,7 @@ const getUserList: (email_or_username: string, loading?: Ref<boolean>) => Promis
* version
*/
const getVersion: (loading?: Ref<boolean>) => Promise<Result<any>> = (loading) => {
return get('/api/profile', undefined, loading)
return get('/profile', undefined, loading)
}
export default {

View File

@ -31,7 +31,7 @@
<span>论坛求助</span>
</div>
</el-card>
<div class="text-center">当前版本号{{ PackageJSON.version }}</div>
<div class="text-center">当前版本号{{ version }}</div>
</div>
<!-- <ul class="about-ui">
<li class="flex mb-16">
@ -52,9 +52,12 @@
</template>
<script setup lang="ts">
import { ref } from 'vue'
import PackageJSON from '../../../../../package.json'
import useStore from '@/stores'
const defaultTitle = import.meta.env.VITE_APP_TITLE
const { user } = useStore()
const version = user.version
const aboutDialogVisible = ref(false)
const open = () => {

View File

@ -47,7 +47,7 @@ const useUserStore = defineStore({
async asyncGetVersion() {
return UserApi.getVersion().then((ok) => {
this.version = ok.data
this.version = ok.data?.version || '0.9.0'
})
},