fix:人脸模型为空导致注册识别引擎出错的问题

This commit is contained in:
dzc committed 2025-04-22 15:27:05 +08:00
1 parent b370be9111
commit 17914f5d10
5 files changed
+41

No files matched your search

+14
View File
@@ -9,6 +9,20 @@ import 'package:pj_supermarket_cloud/common/index.dart';
class SyncFaceTool {
static const _tag = "sync人脸工具";
// 删除数据库中为空的人脸
static Future<void> delEmptyFace() async {
final app = Get.find<AppControl>();
final faceDao = app.dataBase.getFaceDao;
final faceList = await faceDao.getEmptyFaceList();
if (ObjectUtil.isEmptyList(faceList)) return;
for (final v in faceList!) {
if (ObjectUtil.isNotEmpty(v.path)) {
await delFaceByStorage(filePath: v.path!);
}
await faceDao.delById(v.id!);
}
}
// 同步人脸
static Future<void> syncFace({
bool isAll = false,