mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 09:20:18 +08:00
feat: 仅保留混合模式并根据架构动态构建请求路径
- 删除 AppSidebar.vue 中的 StoreModeSwitcher 引入并删除该组件。 - 强制设置当前商店模式为 'hybrid'。 - 修复了因为 `window.apm_store.arch` 包含 `-store` 或 `-apm` 后缀导致路径替换异常的问题,现在会通过动态添加后缀来构建资源请求路径,以兼容 Spark Store 和 APM Store 服务器不同的资源组织结构。
This commit is contained in:
@@ -31,11 +31,9 @@ export const handleInstall = (appObj?: App) => {
|
||||
|
||||
downloadIdCounter += 1;
|
||||
// 创建下载任务
|
||||
const arch = window.apm_store.arch || "amd64-apm";
|
||||
const arch = window.apm_store.arch || "amd64";
|
||||
const finalArch =
|
||||
targetApp.origin === "spark"
|
||||
? arch.replace("-apm", "-store")
|
||||
: arch.replace("-store", "-apm");
|
||||
targetApp.origin === "spark" ? `${arch}-store` : `${arch}-apm`;
|
||||
|
||||
const download: DownloadItem = {
|
||||
id: downloadIdCounter,
|
||||
@@ -55,7 +53,7 @@ export const handleInstall = (appObj?: App) => {
|
||||
source: "APM Store",
|
||||
retry: false,
|
||||
filename: targetApp.filename,
|
||||
metalinkUrl: `${window.apm_store.arch}/${targetApp.category}/${targetApp.pkgname}/${targetApp.filename}.metalink`,
|
||||
metalinkUrl: `${finalArch}/${targetApp.category}/${targetApp.pkgname}/${targetApp.filename}.metalink`,
|
||||
};
|
||||
|
||||
downloads.value.push(download);
|
||||
@@ -73,7 +71,7 @@ export const handleInstall = (appObj?: App) => {
|
||||
.post(
|
||||
"/handle_post",
|
||||
{
|
||||
path: `${window.apm_store.arch}/${targetApp.category}/${targetApp.pkgname}`,
|
||||
path: `${finalArch}/${targetApp.category}/${targetApp.pkgname}`,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
@@ -102,11 +100,8 @@ export const handleUpgrade = (app: App) => {
|
||||
}
|
||||
|
||||
downloadIdCounter += 1;
|
||||
const arch = window.apm_store.arch || "amd64-apm";
|
||||
const finalArch =
|
||||
app.origin === "spark"
|
||||
? arch.replace("-apm", "-store")
|
||||
: arch.replace("-store", "-apm");
|
||||
const arch = window.apm_store.arch || "amd64";
|
||||
const finalArch = app.origin === "spark" ? `${arch}-store` : `${arch}-apm`;
|
||||
|
||||
const download: DownloadItem = {
|
||||
id: downloadIdCounter,
|
||||
|
||||
Reference in New Issue
Block a user