[Ai] chore(init): 初始化项目代码
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { useHttp } from '../utils/userFetchReq'
|
||||
import type { donwloadParam, ButtonListParam, H5param } from './interface'
|
||||
|
||||
// 下载相关接口对齐 bili-landpage-client,域名写死(接口已开 CORS: *)
|
||||
const STAT_API = 'https://blsp01.com/api/stat/version'
|
||||
|
||||
// 按钮开关:iosDown / iosStore / iosTF / iosH5 / androidButton,不含下载地址
|
||||
export const getButtonList = (data: ButtonListParam) => {
|
||||
return useHttp.post(`${STAT_API}/bottonlist`, data, {})
|
||||
}
|
||||
|
||||
// 点击下载:返回 data.link(下载地址数组),同时后端记录点击
|
||||
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, appId: H5_CONFIG_APP_ID }),
|
||||
})
|
||||
if (!res.ok) throw new Error('获取描述文件失败 ' + res.status)
|
||||
return res.text()
|
||||
}
|
||||
|
||||
export const getCustomerServiceUrl = (data: {
|
||||
uid: string
|
||||
appId: number
|
||||
deviceType: string
|
||||
systemType: string
|
||||
systemVersion: string
|
||||
}) => {
|
||||
return useHttp.post('/plm/okn/ijb/fsdfrererdfdf', data, {})
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// 后端返回的数据类型
|
||||
export type HttpResponse<T> = {
|
||||
code?: number
|
||||
data?: T
|
||||
msg?: string
|
||||
}
|
||||
|
||||
export type ButtonListParam = {
|
||||
appId: number
|
||||
ip?: string
|
||||
channel?: string | channel //渠道
|
||||
}
|
||||
export type channel = {
|
||||
dc?: string
|
||||
pc?: string
|
||||
}
|
||||
|
||||
export type donwloadParam = {
|
||||
appId: number
|
||||
ip: string
|
||||
channel: string | channel //渠道
|
||||
domain: string
|
||||
type: string // iosStore / iosDown / iosTF / iosH5
|
||||
terminal: string //终端 ios或者android
|
||||
packageType?: number // 1 企业签 / 2 商店包 / 3 TF
|
||||
}
|
||||
export type H5param = {
|
||||
appId?: number // 请求时固定为 2,见 api/btn.ts downloadH5
|
||||
dc?: string
|
||||
pc?: string
|
||||
[key: string]: number | string | undefined
|
||||
}
|
||||
Reference in New Issue
Block a user