Skip to content

Commit 4c81aa8

Browse files
committed
fix: safari配额不足时提示使用其他浏览器或手动导出
1 parent a25572b commit 4c81aa8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/utils/webdav.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// WebDAV 同步工具
1+
// WebDAV 同步工具
22
interface WebDAVConfig {
33
url: string
44
username: string
@@ -67,5 +67,10 @@ export async function syncFromWebDAV(): Promise<void> {
6767
throw new Error('WebDAV 未配置')
6868

6969
const result = await webdavRequest(config, 'GET')
70-
localStorage.setItem('chatStorage', result.data || '{}')
71-
}
70+
try {
71+
localStorage.setItem('chatStorage', result.data || '{}')
72+
}
73+
catch {
74+
throw new Error('浏览器存储限制,请使用Chrome/Edge或手动导入文件')
75+
}}
76+

0 commit comments

Comments
 (0)