1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-11-13 22:11:42 +08:00

feat: 重构评论交互与请求错误处理,新增搜索页

- 请求层:非 200 响应统一抛 UniHaloError,Halo 来源响应归一化
- 评论弹窗:新增 allowNotification、验证码错误自动刷新与错误详情提示
- 评论回复结构调整为分页结果(replies.items)
- 首页:快捷导航改 5 列、最新列表跳转搜索页,移除旧文章列表页
- 图库:分类切换改用 wd-tabs/wd-tab 组件
- 新增搜索页、uh-data-loading 组件、useDataLoadingStatus 与 exception 工具

Co-Authored-By: AtomCode (deepseek-v4-flash) <noreply@atomgit.com>
This commit is contained in:
小莫唐尼
2026-09-02 00:51:43 +08:00
parent 067f3ed98a
commit 254d0b924b
19 changed files with 737 additions and 623 deletions
+1 -4
View File
@@ -1,9 +1,5 @@
/**
* Halo 官方 API 接口定义
* 覆盖官方扩展点:api.content.halo.run / api.halo.run / api.moment.halo.run /
* api.photo.halo.run / api.link.halo.run / api.plugin.halo.run
* 风格参考 src/api/foo-alova.ts:http.Get<IResponse<T>>(url, { params, header, meta })
* 源自旧项目 api/v2/all.api.js(官方部分),按需命名导出
*/
import { http } from '@/http/alova';
import { RequestFrom } from '@/http/tools/enum';
@@ -144,6 +140,7 @@ export function getPostCommentReplyList(commentName: string, params: ICommentLis
/** 新增评论(带验证码,captchaCode 转入请求头) */
export interface IAddCommentReq {
allowNotification: boolean;
raw: string;
content?: string;
owner?: Record<string, unknown>;
+3 -1
View File
@@ -114,6 +114,8 @@ export type IPostListRes = IListResult<IPost>
/** 文章搜索请求参数(关键字) */
export interface ISearchReq {
keyword?: string
/** 返回条数上限(旧版默认 50) */
limit?: number
page?: number
size?: number
highlightPreTag?: string
@@ -226,7 +228,7 @@ export interface IComment {
replyCount?: number
visibleTime?: string
}
replies?: ICommentReply[]
replies?: IListResult<ICommentReply>
}
export interface ICommentReply {
+2 -1
View File
@@ -284,7 +284,8 @@ export function getDoubanDetail(url: string) {
*/
export function getCommentWidgetCaptcha() {
return http.Get<IResponse<string>>('/apis/api.commentwidget.halo.run/v1alpha1/captcha/-/generate', {
meta: { requestFrom: RequestFrom.Halo },
cacheFor:0,
meta: { requestFrom: RequestFrom.Halo },
})
}