refactor(backend): 重构动物相关 API 接口
- 更新了动物数据结构和相关类型定义 - 优化了动物列表、详情、创建、更新和删除接口 - 新增了更新动物状态接口 - 移除了与认领记录相关的接口 -调整了 API 响应结构
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
<template>
|
||||
<a-config-provider :locale="zhCN">
|
||||
<component :is="layout">
|
||||
<router-view />
|
||||
</component>
|
||||
<div v-if="appStore.state.initialized" class="app-container">
|
||||
<component :is="layout">
|
||||
<router-view />
|
||||
</component>
|
||||
</div>
|
||||
<div v-else class="app-loading">
|
||||
<a-spin size="large" />
|
||||
<p>正在初始化应用...</p>
|
||||
</div>
|
||||
</a-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useAppStore } from '@/stores/app'
|
||||
import MainLayout from '@/layouts/MainLayout.vue'
|
||||
@@ -29,7 +35,9 @@ const layout = computed(() => {
|
||||
})
|
||||
|
||||
// 初始化应用
|
||||
appStore.initialize()
|
||||
onMounted(async () => {
|
||||
await appStore.initialize()
|
||||
})
|
||||
|
||||
// 开发环境调试信息
|
||||
if (import.meta.env.DEV) {
|
||||
@@ -42,4 +50,17 @@ if (import.meta.env.DEV) {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.app-loading {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.app-loading p {
|
||||
margin-top: 16px;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user