This commit is contained in:
2026-09-15 23:20:22 +08:00
3 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -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<string> => {
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()
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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)