|
|
@@ -160,6 +160,30 @@ class NetUtil { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// |
|
|
|
/// 403028 账号被冻结 |
|
|
|
/// 403029 账号被禁用 |
|
|
|
/// 提示并且退出登录 |
|
|
|
/// |
|
|
|
if(result[GlobalConfig.HTTP_RESPONSE_KEY_CODE]?.toString() == '403028' || result[GlobalConfig.HTTP_RESPONSE_KEY_CODE]?.toString() == '403029') { |
|
|
|
|
|
|
|
try { |
|
|
|
// 提示 |
|
|
|
Fluttertoast.showToast( |
|
|
|
msg: result[GlobalConfig.HTTP_RESPONSE_KEY_MSG], |
|
|
|
toastLength: Toast.LENGTH_SHORT, |
|
|
|
gravity: ToastGravity.BOTTOM, |
|
|
|
); |
|
|
|
// 退出登录 |
|
|
|
Future.delayed(Duration(seconds: 0)).then((onValue) { |
|
|
|
BuildContext context = navigatorKey.currentState.overlay.context; |
|
|
|
Provider.of<UserInfoNotifier>(context, listen: false).unLogin(); |
|
|
|
}); |
|
|
|
} catch (e, s) { |
|
|
|
Logger.error(e, s); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
@@ -332,7 +356,8 @@ class NetUtil { |
|
|
|
// token 读取SP缓存中的用户token |
|
|
|
String token = await SharedPreferencesUtil.getStringValue(GlobalConfig.SHARED_KEY_TOKEN); |
|
|
|
if (!EmptyUtil.isEmpty(token)) { |
|
|
|
params['token'] = token; |
|
|
|
// params['token'] = token; |
|
|
|
params['Authorization'] = 'Bearer ' + token; |
|
|
|
} |
|
|
|
// secret_key |
|
|
|
params['secret_key'] = setting['secret_key'] ?? ''; |
|
|
|