mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
增加错误提示
This commit is contained in:
@@ -127,6 +127,7 @@ class Http {
|
||||
}
|
||||
|
||||
static HttpResponse<T> exceptionHandler<T>(DioError e, String path) {
|
||||
logger.e(e);
|
||||
if (e.response?.statusCode == 401 && !Url.inWhiteList(path)) {
|
||||
if (!getIt<UserInfoViewModel>().useSecretLogined) {
|
||||
exitLogin();
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -56,9 +56,6 @@ class ConfigPageState extends State<ConfigPage>
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
onTap: (index) {
|
||||
print(".....$index");
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
|
||||
@@ -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<OtherPage> {
|
||||
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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<T>(ProviderBase<T> provider) {
|
||||
return ProviderScope.containerOf(this, listen: false).read(provider);
|
||||
@@ -18,4 +20,8 @@ extension StringExt on String? {
|
||||
timeInSecForIosWeb: 1,
|
||||
);
|
||||
}
|
||||
|
||||
void log() {
|
||||
logger.i(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user