|
@@ -31,11 +31,24 @@ class SettingController extends GetxController with DioCancelableMixin {
|
|
|
title: "Confirmation".tr,
|
|
|
message: "Are you sure you want to deactivate your account? You will not be able to login into the app once you proceed with the request.".tr,
|
|
|
confirmAction: () {
|
|
|
- ToastEngine.show("确定删除账号");
|
|
|
+ _requestDeactivate();
|
|
|
},
|
|
|
));
|
|
|
}
|
|
|
|
|
|
+ void _requestDeactivate() async {
|
|
|
+ var result = await _authRepository.hotelDeactivate(cancelToken: cancelToken);
|
|
|
+
|
|
|
+ //处理数据
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //清除数据,去首页
|
|
|
+ UserService.to.handleLogoutParams();
|
|
|
+ LoginPage.startWithPopAll();
|
|
|
+ } else {
|
|
|
+ ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//确定退出登录
|
|
|
void doLogout() {
|
|
|
DialogEngine.show(
|
|
@@ -54,7 +67,7 @@ class SettingController extends GetxController with DioCancelableMixin {
|
|
|
|
|
|
//处理数据
|
|
|
if (result.isSuccess) {
|
|
|
- //保存Token,去首页
|
|
|
+ //清除数据,去首页
|
|
|
UserService.to.handleLogoutParams();
|
|
|
LoginPage.startWithPopAll();
|
|
|
} else {
|