feat: 移动端双Token队列拦截器 + 通知列表 + 登录页 + TabBar红点 + v1.0.1

This commit is contained in:
2026-08-07 11:44:20 +08:00
parent 721cfe1504
commit 0df7215134
13 changed files with 1013 additions and 206 deletions

View File

@ -0,0 +1,24 @@
/**
* 消息通知 API — 获取列表、标记已读
*/
import { get, put } from "../utils/request";
/**
* 获取当前用户的通知列表
* @param {string} userId - 当前用户ID
* @param {number} skip - 分页偏移
* @param {number} limit - 每页条数
* @returns {Promise<{notifications: Array, total: number, unread_count: number}>}
*/
export function getNotifications(userId, skip = 0, limit = 20) {
return get("/notifications/", { user_id: userId, skip, limit });
}
/**
* 标记单条通知为已读
* @param {string} notificationId - 通知ID
* @returns {Promise<Object>}
*/
export function markNotificationRead(notificationId) {
return put(`/notifications/${notificationId}/read`);
}