## 构建、打包与分发系统重构 (build/) - 构建系统收敛至 build/ 目录:build.mjs + electron-builder.js + 6 个脚本 - electron-builder 配置从 package.json 提取为 build/electron-builder.js - 新增 --edition (personal/enterprise) 和 --channel (stable/beta/alpha) 参数 - OSS 路径按渠道隔离 - 新增 pre-build-check.mjs:Git/CHANGELOG/版本/环境变量校验 - 新增 bump-version.mjs:版本号管理 + CHANGELOG 自动生成 - updater.ts 发送 channel/edition/deviceFingerprint - 新增 src/shared/utils/rollout.ts 灰度测试工具 - 新增 10 条 NPM 脚本 ## VCHSM 五层架构迁移 - 7 个业务模块 + ~500 处导入路径同步 ## 修复 - MediaCardContextMenu 改用共享 ContextMenu 组件 - ComboBox 尺寸参数显示统一 (size-format.ts) ## 文档 - UpdateA.md / build/README.md / README.md / .env.example 更新 Co-Authored-By: Claude <noreply@anthropic.com>
60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
// ============================================================
|
|
// Banner 模块 — 首页轮播图 API
|
|
// GET /api/v1/banners
|
|
// ============================================================
|
|
|
|
import {get} from '@/shared/services/http';
|
|
|
|
// ---------- 路由常量 ----------
|
|
|
|
const BannerUrlObj = {
|
|
list: '/api/v1/creatives',
|
|
} as const;
|
|
|
|
// ---------- 类型 ----------
|
|
|
|
// ============================================================
|
|
// Banner 分类常量
|
|
// ============================================================
|
|
|
|
export const BannerCategoryEnum = {
|
|
Promotion: "promotion",
|
|
Banner: "banner",
|
|
} as const;
|
|
|
|
export type BannerCategoryValue = typeof BannerCategoryEnum[keyof typeof BannerCategoryEnum];
|
|
|
|
export const BannerCategoryLabelMap: Record<BannerCategoryValue, string> = {
|
|
[BannerCategoryEnum.Promotion]: "推广",
|
|
[BannerCategoryEnum.Banner]: "轮播",
|
|
};
|
|
|
|
/** 单条 Banner */
|
|
export interface Banner {
|
|
id: number;
|
|
title: string;
|
|
content: "真人素材提示";
|
|
image_url: string;
|
|
link_url?: string;
|
|
category: BannerCategoryValue;
|
|
vip_level_id?: number;
|
|
sort_order: number;
|
|
is_active: boolean;
|
|
created_by: string;
|
|
created_at: Date;
|
|
updated_at: Date;
|
|
}
|
|
|
|
/** Banner 列表响应 */
|
|
export type BannerListResponse = Banner[];
|
|
|
|
// ---------- API ----------
|
|
|
|
/**
|
|
* 获取 Banner 轮播图列表
|
|
* GET /api/v1/banners
|
|
*/
|
|
export function fetchBanners(signal?: AbortSignal): Promise<BannerListResponse> {
|
|
return get<BannerListResponse>(BannerUrlObj.list, undefined, { signal });
|
|
}
|