feat: 修改权限问题

This commit is contained in:
2026-01-25 20:07:19 -08:00
parent 94d0a78e89
commit e00754847d
5 changed files with 46 additions and 107 deletions
@@ -38,8 +38,7 @@ class HIAntiLostController extends GetxController {
} else {
// Mobile: Use Gal to save to gallery
// Check permission
final hasAccess = await Gal.hasAccess();
if (!hasAccess) {
if (!await Gal.hasAccess()) {
await Gal.requestAccess();
}
@@ -51,7 +50,11 @@ class HIAntiLostController extends GetxController {
} catch (e) {
debugPrint("Save image error: $e");
if (e is GalException) {
KRCommonUtil.kr_showToast("保存失败: No Permission");
if (e.type == GalExceptionType.accessDenied) {
await Gal.requestAccess();
} else {
KRCommonUtil.kr_showToast("保存失败: ${e.type.name}");
}
} else {
KRCommonUtil.kr_showToast("保存失败: $e");
}