diff --git a/frontend/src/features/listings/views/HomeView.vue b/frontend/src/features/listings/views/HomeView.vue index b223bf8..70e64cb 100644 --- a/frontend/src/features/listings/views/HomeView.vue +++ b/frontend/src/features/listings/views/HomeView.vue @@ -1,6 +1,6 @@ diff --git a/frontend/src/features/listings/views/ListingDetailView.vue b/frontend/src/features/listings/views/ListingDetailView.vue index 0f70057..cc12e9f 100644 --- a/frontend/src/features/listings/views/ListingDetailView.vue +++ b/frontend/src/features/listings/views/ListingDetailView.vue @@ -3,7 +3,8 @@ import { readError } from '@/shared/utils/error' import { ElMessage, ElMessageBox } from 'element-plus' import { computed, nextTick, onMounted, ref, watch } from 'vue' import { useRoute, useRouter } from 'vue-router' -import { ShoppingCart, Star, StarFilled } from '@element-plus/icons-vue' +import { ShoppingCart, Star, StarFilled, ArrowLeft } from '@element-plus/icons-vue' +import { goBackOrHome } from '@/shared/utils/routerBack' import { fetchListing, type Listing } from '@/features/listings/api/listings' import { useListingCollections } from '@/features/listings/composables/useListingCollections' @@ -345,6 +346,10 @@ function handleToggleFavorite() { const added = toggleFavorite(listing.value) ElMessage.success(added ? '已收藏账号' : '已取消收藏') } + +function goBack() { + goBackOrHome(router) +}