mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
修复潜在数据文件导入问题
This commit is contained in:
parent
f30c7f513e
commit
3cd5519e0a
@ -160,7 +160,18 @@ export const handleReadFile = async<T = unknown>(path: string): Promise<T> => {
|
||||
data = await readFile(tempFilePath)
|
||||
await unlink(tempFilePath)
|
||||
}
|
||||
return JSON.parse(data)
|
||||
data = JSON.parse(data)
|
||||
|
||||
// 修复PC v1.14.0出现的导出数据被序列化两次的问题
|
||||
if (typeof data != 'object') {
|
||||
try {
|
||||
data = JSON.parse(data)
|
||||
} catch (err) {
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
export const confirmDialog = async({
|
||||
|
Loading…
x
Reference in New Issue
Block a user