From 7708a7acda9c56d4d84f8d4d5f208dd9856ccc77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E5=AE=87=E5=AE=81?= Date: Tue, 15 Sep 2026 22:16:27 +0700 Subject: [PATCH] =?UTF-8?q?=E5=9B=BA=E5=AE=9Aios=E4=B8=8B=E8=BD=BDappid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/btn.ts | 5 ++++- src/api/interface/index.ts | 2 +- src/utils/useAppDownload.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/api/btn.ts b/src/api/btn.ts index 424831e..a632d5a 100644 --- a/src/api/btn.ts +++ b/src/api/btn.ts @@ -14,12 +14,15 @@ export const bottonclick = (param: donwloadParam) => { return useHttp.post(`${STAT_API}/bottonclick`, param, {}) } +// iOS H5 描述文件的 appId 写死 +const H5_CONFIG_APP_ID = 2 + // iOS H5 描述文件:返回 .mobileconfig 原文(非 JSON),不走 useHttp export const downloadH5 = async (data: H5param): Promise => { const res = await fetch(`${STAT_API}/h5/config`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(data), + body: JSON.stringify({ ...data, appId: H5_CONFIG_APP_ID }), }) if (!res.ok) throw new Error('获取描述文件失败 ' + res.status) return res.text() diff --git a/src/api/interface/index.ts b/src/api/interface/index.ts index 6b8b6e8..147e6df 100644 --- a/src/api/interface/index.ts +++ b/src/api/interface/index.ts @@ -25,7 +25,7 @@ export type donwloadParam = { packageType?: number // 1 企业签 / 2 商店包 / 3 TF } export type H5param = { - appId: number + appId?: number // 请求时固定为 2,见 api/btn.ts downloadH5 dc?: string pc?: string [key: string]: number | string | undefined diff --git a/src/utils/useAppDownload.ts b/src/utils/useAppDownload.ts index 3a13d7f..fab2f3e 100644 --- a/src/utils/useAppDownload.ts +++ b/src/utils/useAppDownload.ts @@ -106,7 +106,7 @@ export function useAppDownload() { } async function downloadMobileConfig() { - const paramData: H5param = { appId: APP_ID } + const paramData: H5param = {} if (route.query.dc) paramData.dc = String(route.query.dc) if (route.query.pc) paramData.pc = String(route.query.pc) const content = await downloadH5(paramData)