Browse Source

[fix]修复上传失败时未清除本地记录的问题

zk 1 year ago
parent
commit
3cfa3f538f
2 changed files with 4 additions and 6 deletions
  1. 1 1
      lib/data/consts/constants.dart
  2. 3 5
      lib/data/repositories/talk_repository.dart

+ 1 - 1
lib/data/consts/constants.dart

@@ -13,7 +13,7 @@ class Constants {
 
   static const String _testBaseUrl = "https://central-test.atmob.com";
 
-  static const String _prodBaseUrl = "http://xxxx.litoxxxxxlive.xyz";
+  static const String _prodBaseUrl = "https://project-api.atmob.com";
 
   static String baseUrl = getBaseUrl();
 

+ 3 - 5
lib/data/repositories/talk_repository.dart

@@ -68,11 +68,6 @@ class TalkRepository {
       if (response.list != null) {
         _talkList.addAll(response.list!);
       }
-      // TalkBean bean = _talkList[0];
-      // Future.delayed(Duration(seconds: 1),(){
-      //   bean.title.value = '1112312';
-      //   bean.createTime = '222222';
-      // });
       return response;
     });
   }
@@ -139,6 +134,9 @@ class TalkRepository {
         .then((response) {
       _uploadingTalkIds.remove(talkId);
       return response.taskId;
+    }).catchError((error) {
+      _uploadingTalkIds.remove(talkId);
+      throw error;
     });
   }
 }