修复局域网连接返回为null问题

This commit is contained in:
2026-03-28 19:49:54 +08:00
parent 4be3087de9
commit a56e360d43
7 changed files with 63 additions and 9 deletions

File diff suppressed because one or more lines are too long

25
frontend/dist/favicon.svg vendored Normal file
View File

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<defs>
<linearGradient id="bg" x1="0%" x2="100%" y1="0%" y2="100%">
<stop offset="0%" stop-color="#1f7ae0" />
<stop offset="100%" stop-color="#5db1ff" />
</linearGradient>
</defs>
<rect width="64" height="64" rx="16" fill="url(#bg)" />
<path
d="M20 39.5a10 10 0 0 1 1.6-19.87A13.5 13.5 0 0 1 47 24.5a8.5 8.5 0 1 1-1.2 16.9H36"
fill="none"
stroke="#fff"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="4"
/>
<path
d="M32 46V28m0 0-7 7m7-7 7 7"
fill="none"
stroke="#fff"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="4"
/>
</svg>

After

Width:  |  Height:  |  Size: 699 B

View File

@@ -3,8 +3,9 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>AirShare Pro</title>
<script type="module" crossorigin src="/assets/index-DoCMU-eK.js"></script>
<script type="module" crossorigin src="/assets/index-BjlDNx75.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-qzWUgf-t.css">
</head>
<body>

View File

@@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>AirShare Pro</title>
</head>
<body>

View File

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<defs>
<linearGradient id="bg" x1="0%" x2="100%" y1="0%" y2="100%">
<stop offset="0%" stop-color="#1f7ae0" />
<stop offset="100%" stop-color="#5db1ff" />
</linearGradient>
</defs>
<rect width="64" height="64" rx="16" fill="url(#bg)" />
<path
d="M20 39.5a10 10 0 0 1 1.6-19.87A13.5 13.5 0 0 1 47 24.5a8.5 8.5 0 1 1-1.2 16.9H36"
fill="none"
stroke="#fff"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="4"
/>
<path
d="M32 46V28m0 0-7 7m7-7 7 7"
fill="none"
stroke="#fff"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="4"
/>
</svg>

After

Width:  |  Height:  |  Size: 699 B

View File

@@ -276,7 +276,8 @@ async function refreshCandidates() {
try {
const candidates = await devicesApi.listCandidates(localDevice.value.id)
devices.value = candidates.map((device) => ({
const safeCandidates = Array.isArray(candidates) ? candidates : []
devices.value = safeCandidates.map((device) => ({
...device,
description: `${formatDeviceType(device.type)} · 最近活跃 ${formatRelativeTime(device.last_seen_at)}`,
icon: mapDeviceIcon(device.type),
@@ -2351,7 +2352,8 @@ refreshCandidates = async function refreshCandidatesOverride() {
return devicesApi
.listCandidates(localDevice.value.id)
.then((candidates) => {
devices.value = candidates.map((device) => ({
const safeCandidates = Array.isArray(candidates) ? candidates : []
devices.value = safeCandidates.map((device) => ({
...device,
description: `${formatDeviceType(device.type)} · 最近活跃 ${formatRelativeTime(device.last_seen_at)}`,
icon: mapDeviceIcon(device.type),