feat: 前后端联调 — 任务创建 + 账户信息 + 预估花费 (0.0.18)

- task: device_id 改为必填参数,API 层 Omit 封装 + getDeviceId() 自动注入
- pricing.ts: Python 后端 calculate_cost 完整移植,六种定价模式 + 6 个 Bug 修复
  (浮点冗余/维度匹配不一致/null 守卫/matrix 数据提取/unit_scale 等)
- ModelInputForm: 三层兜底预估消费展示 + React Hooks 顺序修复
- AccountInfo: VIP 等级列表匹配,套餐详情展示(说明/周期/席位/到期)
- 模型列表加密缓存 (safe-storage, stale-while-revalidate)
- VIP API 模块 (激活码/等级/订单/模拟支付)
- device_id 统一使用 UUID v4 持久化 (与 login/register 对齐)
This commit is contained in:
2026-06-10 19:38:26 +08:00
parent 848fdeca3d
commit 95019316b2
19 changed files with 1681 additions and 292 deletions

View File

@@ -24,6 +24,7 @@ import {
clearStoredRefreshToken,
initRefreshTokenStore,
} from '@/services/auth-token';
import {initModelCache} from '@/services/cache/model-cache';
// ---------- Context 类型 ----------
@@ -114,8 +115,8 @@ export function AppProvider({ children }: AppProviderProps) {
useEffect(() => {
let aborted = false;
// 从加密存储恢复 token 到内存缓存
Promise.all([initTokenStore(), initRefreshTokenStore()]).then(() => {
// 从加密存储恢复 token + 模型缓存 到内存缓存
Promise.all([initTokenStore(), initRefreshTokenStore(), initModelCache()]).then(() => {
if (aborted) return;
// 初始化 401 刷新回调token 缓存就绪后才注册)