diff --git a/src/components/cloud/CloudEditModal.vue b/src/components/cloud/CloudEditModal.vue index 4a68bd1..936fe71 100644 --- a/src/components/cloud/CloudEditModal.vue +++ b/src/components/cloud/CloudEditModal.vue @@ -141,7 +141,7 @@ watch(() => props.initialValue, value => { > diff --git a/src/components/cloud/QuickUploadModal.vue b/src/components/cloud/QuickUploadModal.vue index 2e99a20..f4249d6 100644 --- a/src/components/cloud/QuickUploadModal.vue +++ b/src/components/cloud/QuickUploadModal.vue @@ -271,7 +271,7 @@ onBeforeUnmount(() => { >
{{ activeItem.errors.cloudCategory }}
diff --git a/src/lib/api.ts b/src/lib/api.ts index ab3cfa1..92ccb03 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -141,16 +141,11 @@ export function toAuthUser(profile: BackendUserProfile): AuthUser { return { id: profile.id, email: profile.email, - // Protected profile routes reject unverified accounts, so a successfully - // loaded current profile is necessarily email-verified. - email_verified: true, username: profile.name, - avatar_url: null, + avatar_id: profile.avatar_id, role: profile.role, is_disabled: profile.is_disabled, cloud_count: profile.cloud_count, - public_cloud_count: profile.cloud_count, - collection_count: 0, received_like_count: profile.received_like_count, created_at: profile.created_at, } @@ -160,14 +155,12 @@ export function toCloudType(row: BackendCloudType): CloudType { return { id: row.id, name: row.name, - name_en: row.genus || '', genus: row.genus || '', // Compatibility value for the excluded legacy admin view. Migrated pages // display rarity_value directly because API.md defines no semantic mapping. rarity: 'common', rarity_value: row.rarity, description: row.description, - icon_url: null, created_at: row.created_at, } } @@ -177,12 +170,10 @@ export function toApiCloud(row: BackendCloudInfo): ApiCloud { id: row.id, user_id: row.owner.id, cloud_type_id: row.type.id, - custom_cloud_type: null, image_url: imageUrl(row.id, 'original'), thumbnail_url: imageUrl(row.id, 'preview'), latitude: row.latitude, longitude: row.longitude, - location_name: null, description: row.description, captured_at: row.captured_at, status: row.status, @@ -192,7 +183,6 @@ export function toApiCloud(row: BackendCloudInfo): ApiCloud { cloud_type: { id: row.type.id, name: row.type.name, - name_en: row.type.genus || '', rarity: 'common', rarity_value: row.type.rarity, }, @@ -201,7 +191,6 @@ export function toApiCloud(row: BackendCloudInfo): ApiCloud { cloud_type_rarity: 'common', cloud_type_rarity_value: row.type.rarity, username: row.owner.name, - favorite_count: row.received_like_count, - is_favorited: false, + received_like_count: row.received_like_count, } } diff --git a/src/lib/cloudTypes.ts b/src/lib/cloudTypes.ts index a39464d..94b8821 100644 --- a/src/lib/cloudTypes.ts +++ b/src/lib/cloudTypes.ts @@ -1,14 +1,14 @@ export const CLOUD_TYPES = [ - { id: 1, name: '积云', nameEn: 'Cumulus' }, - { id: 2, name: '层云', nameEn: 'Stratus' }, - { id: 3, name: '卷云', nameEn: 'Cirrus' }, - { id: 4, name: '积雨云', nameEn: 'Cumulonimbus' }, - { id: 5, name: '层积云', nameEn: 'Stratocumulus' }, - { id: 6, name: '高积云', nameEn: 'Altocumulus' }, - { id: 7, name: '高层云', nameEn: 'Altostratus' }, - { id: 8, name: '雨层云', nameEn: 'Nimbostratus' }, - { id: 9, name: '卷层云', nameEn: 'Cirrostratus' }, - { id: 10, name: '卷积云', nameEn: 'Cirrocumulus' }, + { id: 1, name: '积云' }, + { id: 2, name: '层云' }, + { id: 3, name: '卷云' }, + { id: 4, name: '积雨云' }, + { id: 5, name: '层积云' }, + { id: 6, name: '高积云' }, + { id: 7, name: '高层云' }, + { id: 8, name: '雨层云' }, + { id: 9, name: '卷层云' }, + { id: 10, name: '卷积云' }, ] as const export function getCloudTypeName(id: string | string[]) { diff --git a/src/stores/auth.ts b/src/stores/auth.ts index 450d684..df4def1 100644 --- a/src/stores/auth.ts +++ b/src/stores/auth.ts @@ -19,7 +19,7 @@ export const useAuthStore = defineStore('auth', () => { profile.value = { id: normalized.id, username: normalized.username, - avatar_url: normalized.avatar_url, + avatar_id: normalized.avatar_id, role: normalized.role, is_disabled: normalized.is_disabled, created_at: normalized.created_at, diff --git a/src/stores/profile.ts b/src/stores/profile.ts index d30bf00..c3822e2 100644 --- a/src/stores/profile.ts +++ b/src/stores/profile.ts @@ -8,12 +8,10 @@ import type { Profile } from '@/types/database' export interface ProfileCloudItem { id: string cloud_type_id: number - custom_cloud_type: null image_url: string thumbnail_url: string latitude: number longitude: number - location_name: null description: string | null captured_at: string | null created_at: string @@ -21,20 +19,17 @@ export interface ProfileCloudItem { is_hidden: boolean cloudTypeName: string cloudTypeRarity: number - favoriteCount: number - isFavorited: false + receivedLikeCount: number } function toProfileCloud(row: ApiCloud): ProfileCloudItem { return { id: row.id, cloud_type_id: row.cloud_type_id as number, - custom_cloud_type: null, image_url: row.image_url, thumbnail_url: row.thumbnail_url as string, latitude: row.latitude as number, longitude: row.longitude as number, - location_name: null, description: row.description, captured_at: row.captured_at, created_at: row.created_at, @@ -42,8 +37,7 @@ function toProfileCloud(row: ApiCloud): ProfileCloudItem { is_hidden: row.is_hidden, cloudTypeName: row.cloud_type_name || '未知', cloudTypeRarity: row.cloud_type_rarity_value ?? 0, - favoriteCount: row.favorite_count, - isFavorited: false, + receivedLikeCount: row.received_like_count, } } @@ -112,7 +106,7 @@ export const useProfileStore = defineStore('profile-page', () => { profilesByKey.value[identifier] = { id: owner?.id || identifier, username: owner?.name || identifier, - avatar_url: null, + avatar_id: null, role: 'user', is_disabled: false, created_at: '', diff --git a/src/types/api.ts b/src/types/api.ts index f3838f7..13b1b57 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -65,14 +65,11 @@ export interface CloudCreateResponse extends ActionResponse { export interface AuthUser { id: string email: string - email_verified: boolean username: string - avatar_url: string | null + avatar_id: string | null role: Profile['role'] is_disabled: boolean cloud_count: number - public_cloud_count: number - collection_count: number received_like_count: number created_at: string } @@ -88,7 +85,6 @@ export interface ApiPage{{ cloudType.name_en || '未提供云属名称' }}
+{{ cloudType.genus || '未提供云属名称' }}
Cloud Genus
- {{ cloudType.name_en || '未提供云属名称' }} + {{ cloudType.genus || '未提供云属名称' }}
{{ activeItem.errors.cloudCategory }}