diff --git a/lib/base/http/http.dart b/lib/base/http/http.dart index 0832509..52c5dbb 100644 --- a/lib/base/http/http.dart +++ b/lib/base/http/http.dart @@ -127,6 +127,7 @@ class Http { } static HttpResponse exceptionHandler(DioError e, String path) { + logger.e(e); if (e.response?.statusCode == 401 && !Url.inWhiteList(path)) { if (!getIt().useSecretLogined) { exitLogin(); diff --git a/lib/base/userinfo_viewmodel.dart b/lib/base/userinfo_viewmodel.dart index f263895..802339e 100644 --- a/lib/base/userinfo_viewmodel.dart +++ b/lib/base/userinfo_viewmodel.dart @@ -1,7 +1,9 @@ import 'dart:convert'; +import 'package:qinglong_app/utils/extension.dart'; import 'package:qinglong_app/utils/sp_utils.dart'; +import '../main.dart'; import 'sp_const.dart'; import 'theme.dart'; @@ -89,7 +91,7 @@ class UserInfoViewModel { //如果已经存在host,那就更新 - print("login success $_host $userName $passWord"); + "login success $_host $userName $passWord".log(); historyAccounts.removeWhere((element) => element.host == _host); diff --git a/lib/module/config/config_page.dart b/lib/module/config/config_page.dart index dd8e56b..ead80a0 100644 --- a/lib/module/config/config_page.dart +++ b/lib/module/config/config_page.dart @@ -56,9 +56,6 @@ class ConfigPageState extends State width: 2, ), ), - onTap: (index) { - print(".....$index"); - }, ), Expanded( child: TabBarView( diff --git a/lib/module/others/other_page.dart b/lib/module/others/other_page.dart index 7244b8f..56fc0de 100644 --- a/lib/module/others/other_page.dart +++ b/lib/module/others/other_page.dart @@ -1,4 +1,3 @@ -import 'package:dio_log/dio_log.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -379,29 +378,29 @@ class _OtherPageState extends ConsumerState { const SizedBox( height: 30, ), - Center( - child: SizedBox( - width: MediaQuery.of(context).size.width - 40, - child: CupertinoButton( - padding: const EdgeInsets.symmetric( - vertical: 5, - ), - color: ref.watch(themeProvider).themeColor.buttonBgColor(), - child: const Text( - "切换账号", - style: TextStyle( - fontSize: 16, - ), - ), - onPressed: () { - Navigator.of(context).pushNamed(Routes.routeChangeAccount); - }, - ), - ), - ), - const SizedBox( - height: 30, - ), + // Center( + // child: SizedBox( + // width: MediaQuery.of(context).size.width - 40, + // child: CupertinoButton( + // padding: const EdgeInsets.symmetric( + // vertical: 5, + // ), + // color: ref.watch(themeProvider).themeColor.buttonBgColor(), + // child: const Text( + // "切换账号", + // style: TextStyle( + // fontSize: 16, + // ), + // ), + // onPressed: () { + // Navigator.of(context).pushNamed(Routes.routeChangeAccount); + // }, + // ), + // ), + // ), + // const SizedBox( + // height: 30, + // ), Center( child: SizedBox( width: MediaQuery.of(context).size.width - 40, diff --git a/lib/module/task/task_bean.dart b/lib/module/task/task_bean.dart index aa3c8b7..bc56a25 100644 --- a/lib/module/task/task_bean.dart +++ b/lib/module/task/task_bean.dart @@ -2,6 +2,8 @@ import 'dart:convert'; import 'package:json_conversion_annotation/json_conversion_annotation.dart'; +import '../../main.dart'; + @JsonConversion() class TaskBean { String? name; @@ -55,8 +57,7 @@ class TaskBean { lastRunningTime = json['last_running_time']; pid = json['pid'].toString(); } catch (e) { - print(jsonEncode(json)); - print(e); + logger.e(e); } } diff --git a/lib/utils/extension.dart b/lib/utils/extension.dart index 8200689..902c6fc 100644 --- a/lib/utils/extension.dart +++ b/lib/utils/extension.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:fluttertoast/fluttertoast.dart'; +import '../main.dart'; + extension ContextExt on BuildContext { T read(ProviderBase provider) { return ProviderScope.containerOf(this, listen: false).read(provider); @@ -18,4 +20,8 @@ extension StringExt on String? { timeInSecForIosWeb: 1, ); } + + void log() { + logger.i(this); + } } diff --git a/pubspec.yaml b/pubspec.yaml index 53f29a4..0acb808 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: qinglong_app description: A new Flutter project. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.0.4+6 +version: 1.0.5+7 environment: sdk: ">=2.15.1 <3.0.0" diff --git a/version b/version index a6a3a43..1464c52 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.0.4 \ No newline at end of file +1.0.5 \ No newline at end of file