feat: 3.5版本规划

This commit is contained in:
R524809
2026-09-24 17:14:38 +08:00
parent f82ac4d89d
commit 08d9a2792a
19 changed files with 769 additions and 45 deletions
+14 -3
View File
@@ -1,4 +1,10 @@
import { getUser } from './auth';
import tracker from './tracker';
function getCurrentPageRoute(): string {
const pages = getCurrentPages();
return pages[pages.length - 1]?.route || '';
}
export interface FavoriteRecord {
_id: string;
@@ -31,7 +37,9 @@ export async function addFavorite(worksheetId: string): Promise<boolean> {
data: { action: 'add', worksheetId },
});
const result = (res?.result as any) || {};
return result.code === 0;
const success = result.code === 0;
if (success) tracker.reportFavorite(getCurrentPageRoute(), worksheetId, true);
return success;
} catch (e) {
console.error('addFavorite failed', e);
return false;
@@ -49,7 +57,11 @@ export async function removeFavorite(worksheetId: string): Promise<boolean> {
data: { action: 'remove', worksheetId },
});
const result = (res?.result as any) || {};
return result.code === 0;
const success = result.code === 0;
if (success) {
tracker.reportFavorite(getCurrentPageRoute(), worksheetId, false);
}
return success;
} catch (e) {
console.error('removeFavorite failed', e);
return false;
@@ -133,4 +145,3 @@ export async function batchCheckFavorited(
return {};
}
}