Files
hgmj_landpage/src/api/btn.js
T
2026-10-12 21:19:42 +07:00

35 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import request from "@/utils/request";
// 下载相关接口对齐 huangguo_landpage,域名写死(接口已开 CORS: *)
const STAT_API = "https://blsp01.com/api/stat/version";
// 黄果漫剧 App 在下载接口的 appId
export const APP_ID = 5;
// 按钮开关:iosDown / iosStore / iosTF / iosH5 / androidButton,不含下载地址
export const getButtonList = data =>
request({
method: "post",
url: `${STAT_API}/bottonlist`,
data: { ...data, appId: APP_ID }
});
// 点击下载:返回 data.link(下载地址数组),同时后端记录点击
export const bottonclick = data =>
request({
method: "post",
url: `${STAT_API}/bottonclick`,
data: { ...data, appId: APP_ID }
});
// iOS H5 描述文件:返回 .mobileconfig 原文(非 JSON)
export const downloadH5 = async data => {
const res = await fetch(`${STAT_API}/h5/config`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ ...data, appId: APP_ID })
});
if (!res.ok) throw new Error("获取描述文件失败 " + res.status);
return res.text();
};