diff --git a/lib/ui/widgets/app_widgets/aku_avatar.dart b/lib/ui/widgets/app_widgets/aku_avatar.dart index 17d7e1e..22cc34c 100644 --- a/lib/ui/widgets/app_widgets/aku_avatar.dart +++ b/lib/ui/widgets/app_widgets/aku_avatar.dart @@ -20,6 +20,8 @@ class AkuAvatar extends StatelessWidget { return userProvider.isLogin ? Material( color: Colors.grey, + borderRadius: BorderRadius.circular((size ?? 72.w) / 2), + clipBehavior: Clip.antiAlias, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: API.image(userProvider.profileModel.firstImg?.url ?? ''), diff --git a/lib/utils/network/net_util.dart b/lib/utils/network/net_util.dart index 04aeb0b..a139cfa 100644 --- a/lib/utils/network/net_util.dart +++ b/lib/utils/network/net_util.dart @@ -2,8 +2,11 @@ import 'dart:io'; // Package imports: +import 'package:aku_community_manager/provider/user_provider.dart'; +import 'package:aku_community_manager/ui/login/login_page.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:dio/dio.dart'; +import 'package:get/get.dart'; import 'package:power_logger/power_logger.dart'; // Project imports: @@ -11,6 +14,7 @@ import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/utils/network/base_file_model.dart'; import 'package:aku_community_manager/utils/network/base_list_model.dart'; import 'package:aku_community_manager/utils/network/base_model.dart'; +import 'package:provider/provider.dart'; class NetUtil { Dio _dio; @@ -44,7 +48,7 @@ class NetUtil { ///call auth after login auth(String token) { - _dio.options.headers.putIfAbsent('App-Admin-Token', () => token); + _dio.options.headers.putIfAbsent('Butler-Admin-Token', () => token); } /// ## alias of Dio().get @@ -155,11 +159,11 @@ class NetUtil { } _parseRequestError(BaseModel model, {bool showMessage = false}) { - // final userProvider = Provider.of(Get.context, listen: false); - // if (!model.status && model.message == '登录失效,请登录' && userProvider.isLogin) { - // userProvider.logout(); - // Get.offAll(SignInPage()); - // } + final userProvider = Provider.of(Get.context, listen: false); + if (!model.status && model.message == '登录失效,请登录' && userProvider.isLogin) { + userProvider.logout(); + Get.offAll(LoginPage()); + } if (!model.status || showMessage) { BotToast.showText(text: model.message); }