feat: 增加反馈消息闭环相关功能及文件

新增反馈目标登录白名单、账户切换守卫、待确认反馈存储、缓存生命周期管理,补充相关文档及截图,完善消息跳转逻辑
This commit is contained in:
hujun
2026-10-05 20:11:24 +08:00
parent 6b16d4fd55
commit 1723363b7e
154 changed files with 16407 additions and 114 deletions
+7 -7
View File
@@ -18,26 +18,26 @@ function imageUrl(value: string): string {
function sections(value: UTSJSONObject[]): ContentSection[] {
return value.map((item: UTSJSONObject): ContentSection => ({ id: item.getString('id') ?? '', title: item.getString('title') ?? '', body: item.getString('body') ?? '' }))
}
function articleFrom(data: UTSJSONObject): NewsArticle {
export function contentArticleFrom(data: UTSJSONObject): NewsArticle {
return { id: data.getString('id') ?? '', title: data.getString('title') ?? '', summary: data.getString('summary') ?? '', category: data.getString('category') ?? '',
date: data.getString('date') ?? '', source: data.getString('source') ?? '', readingTime: data.getString('readingTime') ?? '', image: imageUrl(data.getString('image') ?? ''),
sections: sections(data['sections'] as UTSJSONObject[]) }
}
function lessonFrom(data: UTSJSONObject): FinanceLesson {
export function contentLessonFrom(data: UTSJSONObject): FinanceLesson {
return { id: data.getString('id') ?? '', title: data.getString('title') ?? '', desc: data.getString('desc') ?? '', duration: data.getString('duration') ?? '', tag: data.getString('tag') ?? '',
image: imageUrl(data.getString('image') ?? ''), intro: data.getString('intro') ?? '', topics: data['topics'] as string[], chapters: sections(data['chapters'] as UTSJSONObject[]),
chapterCount: data.getNumber('chapterCount') ?? 0, lessonVersion: data.getString('lessonVersion') ?? '' }
}
export async function fetchArticles(category: string, page: number = 1): Promise<ArticlePage> {
const data = await requestJson('/content/articles', 'GET', { category, page, pageSize: 20 })
return { items: (data['items'] as UTSJSONObject[]).map((item: UTSJSONObject): NewsArticle => articleFrom(item)), total: data.getNumber('total') ?? 0, hasMore: data.getBoolean('hasMore') ?? false }
return { items: (data['items'] as UTSJSONObject[]).map((item: UTSJSONObject): NewsArticle => contentArticleFrom(item)), total: data.getNumber('total') ?? 0, hasMore: data.getBoolean('hasMore') ?? false }
}
export async function fetchArticle(id: string): Promise<NewsArticle> { return articleFrom(await requestJson('/content/articles/' + encodeURIComponent(id), 'GET', {})) }
export async function fetchArticle(id: string): Promise<NewsArticle> { return contentArticleFrom(await requestJson('/content/articles/' + encodeURIComponent(id), 'GET', {})) }
export async function fetchLessons(topic: string, page: number = 1): Promise<LessonPage> {
const data = await requestJson('/content/lessons', 'GET', { topic, page, pageSize: 20 })
return { items: (data['items'] as UTSJSONObject[]).map((item: UTSJSONObject): FinanceLesson => lessonFrom(item)), total: data.getNumber('total') ?? 0, hasMore: data.getBoolean('hasMore') ?? false }
return { items: (data['items'] as UTSJSONObject[]).map((item: UTSJSONObject): FinanceLesson => contentLessonFrom(item)), total: data.getNumber('total') ?? 0, hasMore: data.getBoolean('hasMore') ?? false }
}
export async function fetchLesson(id: string): Promise<FinanceLesson> { return lessonFrom(await requestJson('/content/lessons/' + encodeURIComponent(id), 'GET', {})) }
export async function fetchLesson(id: string): Promise<FinanceLesson> { return contentLessonFrom(await requestJson('/content/lessons/' + encodeURIComponent(id), 'GET', {})) }
function stateFrom(data: UTSJSONObject): LessonState { return { lessonVersion: data.getString('lessonVersion') ?? '', completedChapterIds: data['completedChapterIds'] as string[] } }
export async function fetchLessonProgress(id: string): Promise<LessonState> { return stateFrom(await requestJson('/content/lessons/' + id + '/progress', 'GET', {})) }
export async function completeLessonChapter(id: string, chapterId: string, lessonVersion: string): Promise<LessonState> {
@@ -45,7 +45,7 @@ export async function completeLessonChapter(id: string, chapterId: string, lesso
}
export async function fetchContentHome(): Promise<ContentHome> {
const data = await requestJson('/content/home', 'GET', {})
return { lessons: (data['lessons'] as UTSJSONObject[]).map((item: UTSJSONObject): FinanceLesson => lessonFrom(item)), articles: (data['articles'] as UTSJSONObject[]).map((item: UTSJSONObject): NewsArticle => articleFrom(item)) }
return { lessons: (data['lessons'] as UTSJSONObject[]).map((item: UTSJSONObject): FinanceLesson => contentLessonFrom(item)), articles: (data['articles'] as UTSJSONObject[]).map((item: UTSJSONObject): NewsArticle => contentArticleFrom(item)) }
}
export async function searchContent(keyword: string, type: string, page: number = 1): Promise<SearchPage> {
const data = await requestJson('/content/search', 'GET', { keyword, type, page, pageSize: 20 })