1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-09-12 16:40:40 +08:00

feat: 小程序端轮播图重写,接入 Banner 归一化公开接口

- uh-swiper 组件高内聚:内部请求 banners 公开列表,去掉前 5 条
  上限,日期角标显示条目 date 快照,新增作者/日期信息浮层
- home.vue 移除配置 list 与审核模式劫持组装,点击分发改为
  post→文章详情(postId)、custom→banner-detail 详情页
- 新增 banner-detail 详情页:公开详情接口 + mp-html 富文本 +
  外链平台条件编译(非 App 端复制链接 / App 端访问按钮)
- 类型与默认配置同步清理(IBannerConfig 移除 type/list)

Co-Authored-By: AtomCode (deepseek-v4-flash) <noreply@atomgit.com>
This commit is contained in:
小莫唐尼
2026-09-02 16:32:39 +08:00
parent 938c09ad4e
commit cf9c02cfc3
6 changed files with 422 additions and 211 deletions
+20
View File
@@ -15,6 +15,8 @@ import { getPersonalToken } from '@/store/token'
import type {
IAppConfig,
IAuditDataResult,
IBannerPublicDetail,
IBannerPublicItem,
ICommentWidgetConfig,
IDoubanDetail,
IHaloGlobalConfig,
@@ -67,6 +69,24 @@ export function getAuditData() {
})
}
/**
* 获取首页轮播图列表(公开;按 priority 有序,脱敏不含 content)
*/
export function getBanners() {
return http.Get<IResponse<IBannerPublicItem[]>>('/apis/api.unihalo.ialley.cn/v1alpha1/plugins/plugin-uni-halo/banners', {
meta: { requestFrom: RequestFrom.Halo },
})
}
/**
* 获取轮播图详情(公开;含 content 富文本 HTML)
*/
export function getBannerDetail(name: string) {
return http.Get<IResponse<IBannerPublicDetail>>(`/apis/api.unihalo.ialley.cn/v1alpha1/plugins/plugin-uni-halo/banners/${name}`, {
meta: { requestFrom: RequestFrom.Halo },
})
}
/**
* 获取 Halo 全局配置信息
*/