feat(security): 完善超管平台订阅守卫拦截与移动端高意向访客提醒

这个提交包含在:
wikiboss
2026-09-21 11:15:59 +08:00
父节点 654f317c59
当前提交 c58a99d602
共有 7 个文件被更改,包括 93 次插入 和 4 次删除

查看文件

@@ -10,7 +10,11 @@ import {
OwnerPageQuery,
RadarTrack,
} from '../../common/types.uts';
import { fetchOwnerLeadPage, fetchOwnerRadarPage } from '../../common/api.uts';
import {
fetchOwnerLeadPage,
fetchOwnerRadarPage,
fetchRadarHotInbox,
} from '../../common/api.uts';
import { getCurrentLocale, getOmniText } from '../../common/locale.uts';
import { formatLocation, formatStay } from './useRadar.uts';
@@ -29,7 +33,8 @@ export type LeadsCopyKey =
| 'error'
| 'loading'
| 'score'
| 'radarMore';
| 'radarMore'
| 'hotBadge';
export type LoadLeadsQuery = {
page: number;
@@ -58,6 +63,7 @@ export type LoadLeadsResult = {
export type LeadsState = {
list: LeadEntity[];
radarTracks: RadarTrack[];
hotUnread: number;
page: number;
size: number;
total: number;
@@ -154,9 +160,19 @@ export function resolveLeadsText(key: LeadsCopyKey): string {
if (key === 'radarMore') {
return zh ? '查看全部雷达' : 'Full radar';
}
if (key === 'hotBadge') {
return zh ? '高意向访客' : 'Hot visitors';
}
return '';
}
export function formatHotUnread(unread: number): string {
if (unread < 1) {
return '';
}
return `${resolveLeadsText('hotBadge')} ${unread}`;
}
export function statusLabel(status: string): string {
if (status === 'new') {
return resolveLeadsText('statusNew');
@@ -244,6 +260,7 @@ export function createLeadsState(): LeadsState {
return {
list: [],
radarTracks: [],
hotUnread: 0,
page: 1,
size: 20,
total: 0,
@@ -318,6 +335,12 @@ export async function refreshLeads(
} catch (_err) {
state.radarTracks = [];
}
try {
const inbox = await fetchRadarHotInbox();
state.hotUnread = inbox != null && inbox.unread != null ? inbox.unread : 0;
} catch (_err) {
state.hotUnread = 0;
}
state.loading = false;
return result;
}