修复脚本管理数据

This commit is contained in:
whyour
2021-11-12 23:18:24 +08:00
parent ee0b47d101
commit a2ce3304de
4 changed files with 67 additions and 54 deletions
+11
View File
@@ -220,3 +220,14 @@ export function getPlatform(userAgent: string): 'mobile' | 'desktop' {
return platform as 'mobile' | 'desktop';
}
export async function fileExist(file: any) {
return new Promise((resolve) => {
try {
fs.accessSync(file);
resolve(true);
} catch (error) {
resolve(false);
}
});
}