feat:修复基础格式问题

This commit is contained in:
2026-03-09 23:56:44 +08:00
parent 1e2047e7f1
commit 21ea334e79
6 changed files with 49 additions and 21 deletions

View File

@@ -180,7 +180,7 @@ const axiosInstance = axios.create({
timeout: 5000, // 增加到 5 秒,避免网络波动导致的超时
});
const fetchWithRetry = async <T>(
const fetchWithRetry = async <T,>(
url: string,
retries = 3,
delay = 1000,
@@ -422,7 +422,8 @@ const loadHome = async () => {
if (realRes.ok) {
const realApp = await realRes.json();
// 用真实json的filename字段和More字段来增补和覆盖当前的json
if (realApp.Filename) baseApp.filename = realApp.Filename;
if (realApp.Filename)
baseApp.filename = realApp.Filename;
if (realApp.More) baseApp.more = realApp.More;
if (realApp.Name) baseApp.name = realApp.Name;
}

View File

@@ -21,15 +21,15 @@
<div
class="flex h-20 w-20 items-center justify-center overflow-hidden rounded-3xl bg-gradient-to-b from-slate-100 to-slate-200 shadow-inner dark:from-slate-800 dark:to-slate-700"
>
<img
v-if="app"
:src="iconPath"
alt="icon"
class="h-full w-full object-cover transition-opacity duration-300"
:class="isIconLoaded ? 'opacity-100' : 'opacity-0'"
loading="lazy"
@load="isIconLoaded = true"
/>
<img
v-if="app"
:src="iconPath"
alt="icon"
class="h-full w-full object-cover transition-opacity duration-300"
:class="isIconLoaded ? 'opacity-100' : 'opacity-0'"
loading="lazy"
@load="isIconLoaded = true"
/>
</div>
<div class="space-y-1">
<div class="flex items-center gap-3">

View File

@@ -10,7 +10,11 @@
>
<i class="fas fa-bars"></i>
</button>
<TopActions @update="$emit('update')" @list="$emit('list')" @open-install-settings="$emit('open-install-settings')" />
<TopActions
@update="$emit('update')"
@list="$emit('list')"
@open-install-settings="$emit('open-install-settings')"
/>
</div>
<div class="w-full flex-1">
<label for="searchBox" class="sr-only">搜索应用</label>
@@ -29,8 +33,12 @@
</div>
</div>
</div>
<div v-if="activeCategory !== 'home'" class="text-sm text-slate-500 dark:text-slate-400" id="currentCount">
{{ appsCount }} 个应用
<div
v-if="activeCategory !== 'home'"
class="text-sm text-slate-500 dark:text-slate-400"
id="currentCount"
>
{{ appsCount }} 个应用
</div>
</div>
</template>

View File

@@ -1,6 +1,8 @@
<template>
<div class="space-y-6">
<div v-if="loading" class="text-center text-slate-500">正在加载首页内容</div>
<div v-if="loading" class="text-center text-slate-500">
正在加载首页内容
</div>
<div v-else-if="error" class="text-center text-rose-600">{{ error }}</div>
<div v-else>
<div class="grid gap-4 auto-fit-grid">
@@ -17,7 +19,9 @@
class="h-20 w-full object-contain"
loading="lazy"
/>
<div class="text-base font-semibold text-slate-900">{{ link.name }}</div>
<div class="text-base font-semibold text-slate-900">
{{ link.name }}
</div>
<div class="text-sm text-slate-500">{{ link.more }}</div>
</a>
</div>
@@ -25,7 +29,9 @@
<div class="space-y-6 mt-6">
<section v-for="section in lists" :key="section.title">
<div class="flex items-center justify-between">
<h3 class="text-lg font-semibold text-slate-900">{{ section.title }}</h3>
<h3 class="text-lg font-semibold text-slate-900">
{{ section.title }}
</h3>
</div>
<div class="mt-3 grid gap-4 auto-fit-grid">
<AppCard