refactor: ♻️ 界面设置页面重构,抽离逻辑 #96

This commit is contained in:
LOG1997
2025-12-11 23:18:10 +08:00
parent bfc593fa8e
commit c9efd62e34
14 changed files with 756 additions and 430 deletions

View File

@@ -23,3 +23,13 @@ export async function readLocalFileAsArraybuffer(path: string): Promise<ArrayBuf
const arrayBuffer = await response.arrayBuffer()
return arrayBuffer
}
export async function readFileAsJsonData(file: File | Blob): Promise<any> {
return new Promise((resolve) => {
const reader = new FileReader()
reader.readAsText(file, 'utf-8')
reader.onload = (ev: any) => {
resolve(ev.target.result)
}
})
}