更新特殊处理测试账号
This commit is contained in:
@@ -105,6 +105,11 @@ class LoginController extends GetControllerEx<LoginModel> {
|
||||
UserInfoController userInfoController = Get.find();
|
||||
userInfoController.model.login = 1;
|
||||
userInfoController.model.user = UserModel.fromJson(res.data);
|
||||
if (res.data['test'] != null && res.data['test'] == true) {
|
||||
AppConstants.is_test_account = true;
|
||||
} else {
|
||||
AppConstants.is_test_account = false;
|
||||
}
|
||||
String token = response.headers['token']!.first;
|
||||
EasyDartModule.dio.token = token;
|
||||
final box = GetStorage();
|
||||
@@ -178,11 +183,14 @@ class LoginController extends GetControllerEx<LoginModel> {
|
||||
res.msg = "其他手机登录页.发送成功".tr;
|
||||
}
|
||||
}
|
||||
EasyDartModule.logger.info('msg:发送验证码成功');
|
||||
return res;
|
||||
} else {
|
||||
EasyDartModule.logger.error('msg:发送验证码失败:${response}');
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
} catch (e) {
|
||||
EasyDartModule.logger.error('msg:发送验证码失败:${e}');
|
||||
return ApiResponse(code: -1, msg: "失败".tr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,6 +225,11 @@ class UserInfoController extends GetControllerEx<UserInfoModel> {
|
||||
MyUtils.formatResponse(apiResponse, "保存成功".tr, "保存失败".tr);
|
||||
if (res.code == HttpStatusCodes.ok) {
|
||||
UserInfoController userInfoController = Get.find();
|
||||
if (res.data['test'] != null && res.data['test'] == true) {
|
||||
AppConstants.is_test_account = true;
|
||||
} else {
|
||||
AppConstants.is_test_account = false;
|
||||
}
|
||||
userInfoController.model.user = UserModel.fromJson(res.data);
|
||||
final box = GetStorage();
|
||||
box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息
|
||||
|
||||
Reference in New Issue
Block a user