diff --git a/tenant-platform/src/api/push.ts b/tenant-platform/src/api/push.ts index 69d8008..5518cd7 100644 --- a/tenant-platform/src/api/push.ts +++ b/tenant-platform/src/api/push.ts @@ -9,6 +9,7 @@ export interface DeviceInfo { brand: string | null model: string | null osVersion: string | null + romVersion: string | null appVersion: string | null receivePush: boolean lastLoginAt: string | null @@ -95,4 +96,10 @@ export const pushAdminApi = { '/push/admin/operation-logs', { params: { appKey, page, size } }, ) }, + + getDeviceToken(appKey: string, deviceId: string) { + return client.get<{ data: { token: string } }>(`/push/admin/devices/${deviceId}/token`, { + params: { appKey }, + }) + }, } diff --git a/tenant-platform/src/views/push/PushManagementView.vue b/tenant-platform/src/views/push/PushManagementView.vue index 393fa29..783e1b5 100644 --- a/tenant-platform/src/views/push/PushManagementView.vue +++ b/tenant-platform/src/views/push/PushManagementView.vue @@ -74,9 +74,23 @@ - + + + {{ row.osVersion || '-' }} + {{ row.romVersion }} + + - + + + + {{ row.tokenPreview }} + + 复制 + + + + @@ -290,6 +304,17 @@ async function sendTestPush() { } } +async function copyToken(row: { id: string; tokenPreview: string }) { + try { + const res = await pushAdminApi.getDeviceToken(appKey.value, row.id) + await navigator.clipboard.writeText(res.data.data.token) + ElMessage.success('Token 已复制') + } catch { + await navigator.clipboard.writeText(row.tokenPreview) + ElMessage.info('已复制 Token 预览') + } +} + async function loadLogs() { const uid = logsUserId.value.trim() if (!uid) return