mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 09:20:18 +08:00
@@ -151,6 +151,7 @@ const axiosInstance = axios.create({
|
|||||||
baseURL: APM_STORE_BASE_URL,
|
baseURL: APM_STORE_BASE_URL,
|
||||||
timeout: 5000, // 增加到 5 秒,避免网络波动导致的超时
|
timeout: 5000, // 增加到 5 秒,避免网络波动导致的超时
|
||||||
});
|
});
|
||||||
|
const cacheBuster = (url: string) => `${url}?cb=${Date.now()}`;
|
||||||
|
|
||||||
// 响应式状态
|
// 响应式状态
|
||||||
const themeMode = ref<"light" | "dark" | "auto">("auto");
|
const themeMode = ref<"light" | "dark" | "auto">("auto");
|
||||||
@@ -621,7 +622,7 @@ const openDownloadedApp = (pkgname: string) => {
|
|||||||
const loadCategories = async () => {
|
const loadCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axiosInstance.get(
|
const response = await axiosInstance.get(
|
||||||
`/${window.apm_store.arch}/categories.json`,
|
cacheBuster(`/${window.apm_store.arch}/categories.json`),
|
||||||
);
|
);
|
||||||
categories.value = response.data;
|
categories.value = response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -639,7 +640,7 @@ const loadApps = async () => {
|
|||||||
try {
|
try {
|
||||||
logger.info(`加载分类: ${category}`);
|
logger.info(`加载分类: ${category}`);
|
||||||
const response = await axiosInstance.get<AppJson[]>(
|
const response = await axiosInstance.get<AppJson[]>(
|
||||||
`/${window.apm_store.arch}/${category}/applist.json`,
|
cacheBuster(`/${window.apm_store.arch}/${category}/applist.json`),
|
||||||
);
|
);
|
||||||
|
|
||||||
const categoryApps = response.status === 200 ? response.data : [];
|
const categoryApps = response.status === 200 ? response.data : [];
|
||||||
|
|||||||
Reference in New Issue
Block a user