refactor: 重构存储与接口适配,统一金额单位与会话管理

- 新增配置、存储、金额转换工具服务
- 按userId隔离本地缓存,替换旧设备级存储
- 统一移动端金额单位为万元,新增转换适配逻辑
- 重构认证与请求逻辑,支持真实后端会话
- 调整搜索、帮助、融资模块的模拟开关与数据适配
- 更新文档说明开发状态与配置规则
This commit is contained in:
hujun
2026-09-22 17:25:52 +08:00
parent 4a69357606
commit dcf12a4471
25 changed files with 1619 additions and 143 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { API_BASE_URL, requestJson } from '@/services/api.uts'
import { API_DEMO_ENABLED, API_BASE_URL, requestJson } from '@/services/api.uts'
import { newsArticles, financeLessons, ContentSection } from './content.uts'
export type ContentSearchResult = {
@@ -14,7 +14,7 @@ export async function searchContent(keyword: string, type: string): Promise<Cont
const query = keyword.trim().replace(/\s+/g, ' ')
const results: ContentSearchResult[] = []
if (query.length == 0) return results
if (API_BASE_URL.length > 0) {
if (!API_DEMO_ENABLED) {
const response = await requestJson('/content/search', 'GET', { keyword: query, type })
const items = response['items'] as UTSJSONObject[] | null
if (items == null) throw new Error('搜索结果加载失败,请重试')