mcy_new #1
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
@ -22,8 +23,8 @@ class LoginLogic extends GetxController with RequestToolMixin {
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
state.userNameController = TextEditingController(text: 'longyunfei')..addListener(userNameListener);
|
state.userNameController = TextEditingController()..addListener(userNameListener);
|
||||||
state.passwordController = TextEditingController(text: '123@abc');
|
state.passwordController = TextEditingController();
|
||||||
state.pwdFocus = FocusNode();
|
state.pwdFocus = FocusNode();
|
||||||
state.theFocus = FocusNode();
|
state.theFocus = FocusNode();
|
||||||
}
|
}
|
||||||
|
|
@ -114,6 +115,12 @@ class LoginLogic extends GetxController with RequestToolMixin {
|
||||||
StorageService.to.erase();
|
StorageService.to.erase();
|
||||||
if (e is Exception) {
|
if (e is Exception) {
|
||||||
try {
|
try {
|
||||||
|
if (e is DioException && e.response?.data != null) {
|
||||||
|
Map? msg = e.response?.data['error'];
|
||||||
|
if (msg != null && msg["message"] != null) {
|
||||||
|
return toMsg(msg["message"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
toMsg(e.toString().split(":")[1]);
|
toMsg(e.toString().split(":")[1]);
|
||||||
return;
|
return;
|
||||||
// ignore: empty_catches
|
// ignore: empty_catches
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue