fix(runtime): contact-stores initState httpGet.then setState 加 mounted 保护 (dispose 后 setState)

This commit is contained in:
2026-08-01 23:29:08 +08:00
parent 1d4028f486
commit 048c5a9ff4

View File

@@ -383,13 +383,14 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
'service': Constants.WEB_MINISTORE_SERVICE 'service': Constants.WEB_MINISTORE_SERVICE
} }
).then((value) { ).then((value) {
if (!mounted) return;
setState(() { setState(() {
stores = value['stores']; stores = value['stores'];
service = value['service']; service = value['service'];
group = Group.fromJson(value['group']); group = Group.fromJson(value['group']);
print('stores: ${value}');
}); });
}).onError((error, stackTrace) { }).onError((error, stackTrace) {
if (!mounted) return;
Utils.showMessageDialog(context, error, onOk: () { Utils.showMessageDialog(context, error, onOk: () {
Routes.router.navigateTo(context, '/'); Routes.router.navigateTo(context, '/');
}); });