feat: 修改权限问题
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user