mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 01:10:16 +08:00
feat: 仅保留混合模式并根据架构动态构建请求路径
- 删除 AppSidebar.vue 中的 StoreModeSwitcher 引入并删除该组件。 - 强制设置当前商店模式为 'hybrid'。 - 修复了因为 `window.apm_store.arch` 包含 `-store` 或 `-apm` 后缀导致路径替换异常的问题,现在会通过动态添加后缀来构建资源请求路径,以兼容 Spark Store 和 APM Store 服务器不同的资源组织结构。
This commit is contained in:
@@ -109,7 +109,13 @@
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center gap-2 rounded-2xl bg-gradient-to-r from-brand to-brand-dark px-4 py-2 text-sm font-semibold text-white shadow-lg transition hover:-translate-y-0.5"
|
||||
@click="emit('open-app', displayApp?.pkgname || '', displayApp?.origin)"
|
||||
@click="
|
||||
emit(
|
||||
'open-app',
|
||||
displayApp?.pkgname || '',
|
||||
displayApp?.origin,
|
||||
)
|
||||
"
|
||||
>
|
||||
<i class="fas fa-external-link-alt"></i>
|
||||
<span>打开</span>
|
||||
@@ -343,11 +349,9 @@ const installBtnText = computed(() => {
|
||||
});
|
||||
const iconPath = computed(() => {
|
||||
if (!displayApp.value) return "";
|
||||
const arch = window.apm_store.arch || "amd64-apm";
|
||||
const arch = window.apm_store.arch || "amd64";
|
||||
const finalArch =
|
||||
displayApp.value.origin === "spark"
|
||||
? arch.replace("-apm", "-store")
|
||||
: arch.replace("-store", "-apm");
|
||||
displayApp.value.origin === "spark" ? `${arch}-store` : `${arch}-apm`;
|
||||
return `${APM_STORE_BASE_URL}/${finalArch}/${displayApp.value.category}/${displayApp.value.pkgname}/icon.png`;
|
||||
});
|
||||
|
||||
@@ -360,11 +364,9 @@ watch(
|
||||
if (newApp) {
|
||||
downloadCount.value = "";
|
||||
try {
|
||||
const arch = window.apm_store.arch || "amd64-apm";
|
||||
const arch = window.apm_store.arch || "amd64";
|
||||
const finalArch =
|
||||
newApp.origin === "spark"
|
||||
? arch.replace("-apm", "-store")
|
||||
: arch.replace("-store", "-apm");
|
||||
newApp.origin === "spark" ? `${arch}-store` : `${arch}-apm`;
|
||||
const url = `${APM_STORE_BASE_URL}/${finalArch}/${newApp.category}/${newApp.pkgname}/download-times.txt`;
|
||||
const resp = await axios.get(url, { responseType: "text" });
|
||||
if (resp.status === 200) {
|
||||
|
||||
Reference in New Issue
Block a user