Yansen 2 年之前
父節點
當前提交
4cf9a25449
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. 2
    2
      lib/utils/Request.dart

+ 2
- 2
lib/utils/Request.dart 查看文件

52
     // you can reject a `DioError` object eg: `handler.reject(dioError)`
52
     // you can reject a `DioError` object eg: `handler.reject(dioError)`
53
   }, onResponse: (response, handler) {
53
   }, onResponse: (response, handler) {
54
     var resp = response.data as Map<String, dynamic>;
54
     var resp = response.data as Map<String, dynamic>;
55
-    if(resp['code']==1001){
55
+    if(resp['code']==1001 || resp['code']==1002){
56
       Fluttertoast.showToast(msg: '登录过期请重新登录!');
56
       Fluttertoast.showToast(msg: '登录过期请重新登录!');
57
       box.remove('token');
57
       box.remove('token');
58
-      Get.offAllNamed('/login');
58
+      Get.toNamed('/login?isBack=true');
59
       return handler.next(response);
59
       return handler.next(response);
60
     }
60
     }
61
     if (resp['code'] == 1000) {
61
     if (resp['code'] == 1000) {