refactor(api): 对齐后端字段,移除前端臆造字段
This commit is contained in:
@@ -178,18 +178,18 @@ function toAdminCloud(row: ApiCloud): AdminCloud {
|
||||
id: row.id,
|
||||
user_id: row.user_id,
|
||||
cloud_type_id: row.cloud_type_id,
|
||||
custom_cloud_type: row.custom_cloud_type,
|
||||
custom_cloud_type: null,
|
||||
image_url: row.image_url,
|
||||
thumbnail_url: row.thumbnail_url,
|
||||
latitude: row.latitude,
|
||||
longitude: row.longitude,
|
||||
location_name: row.location_name,
|
||||
location_name: null,
|
||||
description: row.description,
|
||||
captured_at: row.captured_at,
|
||||
created_at: row.created_at,
|
||||
status: row.status,
|
||||
is_hidden: row.is_hidden,
|
||||
cloudTypeName: row.cloud_type_name || row.custom_cloud_type || '未知云型',
|
||||
cloudTypeName: row.cloud_type_name || '未知云型',
|
||||
cloudTypeRarity: row.cloud_type_rarity || 'common',
|
||||
username: row.username || '匿名用户',
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ watch(() => route.params.id, () => loadPage())
|
||||
<div class="absolute bottom-7 left-7 right-7 text-white">
|
||||
<span class="border border-white/35 bg-slate-950/25 px-2.5 py-1 text-xs backdrop-blur">稀有度 {{ cloudType.rarity_value }}</span>
|
||||
<h1 class="mt-4 text-4xl font-bold">{{ cloudType.name }}</h1>
|
||||
<p class="mt-2 text-white/80">{{ cloudType.name_en || '未提供云属名称' }}</p>
|
||||
<p class="mt-2 text-white/80">{{ cloudType.genus || '未提供云属名称' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-8">
|
||||
|
||||
@@ -44,7 +44,7 @@ onMounted(() => encyclopediaStore.fetchCloudTypes())
|
||||
<p class="oc-section-label">Cloud Genus</p>
|
||||
<h2 class="mt-2 text-xl font-bold text-slate-900">{{ cloudType.name }}</h2>
|
||||
<p class="mt-1 font-mono text-xs uppercase tracking-[0.12em] text-slate-500">
|
||||
{{ cloudType.name_en || '未提供云属名称' }}
|
||||
{{ cloudType.genus || '未提供云属名称' }}
|
||||
</p>
|
||||
</div>
|
||||
<span class="shrink-0 border border-slate-200 bg-slate-50 px-2.5 py-1 text-xs font-medium text-slate-600">
|
||||
|
||||
@@ -17,10 +17,8 @@ interface GalleryCloud {
|
||||
id: string
|
||||
user_id: string
|
||||
cloud_type_id: number | null
|
||||
custom_cloud_type: string | null
|
||||
image_url: string
|
||||
thumbnail_url: string | null
|
||||
location_name: string | null
|
||||
description: string | null
|
||||
latitude: number | null
|
||||
longitude: number | null
|
||||
@@ -88,10 +86,8 @@ function toGalleryCloud(row: ApiCloud) {
|
||||
id: row.id,
|
||||
user_id: row.user_id,
|
||||
cloud_type_id: row.cloud_type_id,
|
||||
custom_cloud_type: row.custom_cloud_type,
|
||||
image_url: row.image_url,
|
||||
thumbnail_url: row.thumbnail_url,
|
||||
location_name: row.location_name,
|
||||
description: row.description,
|
||||
latitude: row.latitude,
|
||||
longitude: row.longitude,
|
||||
@@ -99,7 +95,7 @@ function toGalleryCloud(row: ApiCloud) {
|
||||
created_at: row.created_at,
|
||||
status: row.status,
|
||||
is_hidden: row.is_hidden,
|
||||
cloudTypeName: row.cloud_type_name || row.custom_cloud_type || '未知',
|
||||
cloudTypeName: row.cloud_type_name || '未知',
|
||||
cloudTypeRarity: row.cloud_type_rarity_value ?? 0,
|
||||
username: row.username || '匿名',
|
||||
} satisfies GalleryCloud
|
||||
@@ -554,7 +550,6 @@ onUnmounted(() => {
|
||||
<MiniLocationMap
|
||||
:latitude="selectedCloud.latitude"
|
||||
:longitude="selectedCloud.longitude"
|
||||
:location-name="selectedCloud.location_name"
|
||||
/>
|
||||
|
||||
<template v-if="selectedCloudIsMine" #actions>
|
||||
|
||||
@@ -16,7 +16,6 @@ interface CloudMarkerData {
|
||||
longitude: number
|
||||
imageUrl: string
|
||||
thumbnailUrl: string | null
|
||||
locationName: string | null
|
||||
description: string | null
|
||||
cloudTypeName: string
|
||||
rarity: number
|
||||
@@ -412,9 +411,8 @@ function toCloudMarker(row: ApiCloud): CloudMarkerData {
|
||||
longitude: row.longitude as number,
|
||||
imageUrl: row.image_url,
|
||||
thumbnailUrl: row.thumbnail_url,
|
||||
locationName: row.location_name,
|
||||
description: row.description,
|
||||
cloudTypeName: row.cloud_type_name || row.custom_cloud_type || '未知',
|
||||
cloudTypeName: row.cloud_type_name || '未知',
|
||||
rarity: row.cloud_type_rarity_value ?? 0,
|
||||
username: row.username || '匿名',
|
||||
capturedAt: row.captured_at || row.created_at,
|
||||
@@ -863,7 +861,6 @@ onUnmounted(() => {
|
||||
<MiniLocationMap
|
||||
:latitude="previewCloud.latitude"
|
||||
:longitude="previewCloud.longitude"
|
||||
:location-name="previewCloud.locationName"
|
||||
/>
|
||||
</ImageDetailModal>
|
||||
|
||||
|
||||
@@ -439,8 +439,8 @@ watch(selectedUploadDate, async newValue => {
|
||||
class="profile-avatar flex h-20 w-20 shrink-0 items-center justify-center border border-slate-300 bg-[linear-gradient(135deg,#eef9f3_0%,#d9efe3_100%)] text-3xl font-bold text-slate-900"
|
||||
>
|
||||
<img
|
||||
v-if="profileData?.avatar_url"
|
||||
:src="profileData.avatar_url"
|
||||
v-if="profileData?.avatar_id"
|
||||
:src="profileData.avatar_id"
|
||||
:alt="profileData.username"
|
||||
class="h-full w-full object-cover"
|
||||
/>
|
||||
@@ -756,7 +756,6 @@ watch(selectedUploadDate, async newValue => {
|
||||
<MiniLocationMap
|
||||
:latitude="selectedCloud.latitude"
|
||||
:longitude="selectedCloud.longitude"
|
||||
:location-name="selectedCloud.location_name"
|
||||
/>
|
||||
|
||||
<template v-if="isOwnProfile" #actions>
|
||||
|
||||
@@ -279,7 +279,7 @@ onUnmounted(() => {
|
||||
>
|
||||
<option value="" disabled>请选择</option>
|
||||
<option v-for="ct in cloudsStore.cloudTypes" :key="ct.id" :value="ct.id">
|
||||
{{ ct.name }}({{ ct.name_en }})
|
||||
{{ ct.name }}{{ ct.genus ? '(' + ct.genus + ')' : '' }}
|
||||
</option>
|
||||
</select>
|
||||
<p v-if="activeItem.errors.cloudCategory" class="oc-field-error">{{ activeItem.errors.cloudCategory }}</p>
|
||||
|
||||
Reference in New Issue
Block a user