mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: 补充部分异常报错
This commit is contained in:
@@ -57,6 +57,8 @@ class VideoCardV extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
);
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
break;
|
||||
case 'av':
|
||||
@@ -94,6 +96,8 @@ class VideoCardV extends StatelessWidget {
|
||||
'floor': 1,
|
||||
'action': 'detail'
|
||||
});
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ class SearchHttp {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': '请求错误 🙅',
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,18 +197,19 @@ class VideoHttp {
|
||||
if (result.code == 0) {
|
||||
return {'status': true, 'data': result.data!};
|
||||
} else {
|
||||
Map errMap = {
|
||||
-400: '请求错误',
|
||||
-403: '权限不足',
|
||||
-404: '视频资源失效',
|
||||
62002: '稿件不可见',
|
||||
62004: '稿件审核中',
|
||||
};
|
||||
// Map errMap = {
|
||||
// -400: '请求错误',
|
||||
// -403: '权限不足',
|
||||
// -404: '视频资源失效',
|
||||
// 62002: '稿件不可见',
|
||||
// 62004: '稿件审核中',
|
||||
// };
|
||||
return {
|
||||
'status': false,
|
||||
'data': null,
|
||||
'code': result.code,
|
||||
'msg': errMap[result.code] ?? '请求异常',
|
||||
'msg': result.message,
|
||||
// 'msg': errMap[result.code] ?? '请求异常',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +102,8 @@ class BangumiIntroController extends GetxController {
|
||||
if (result['status']) {
|
||||
bangumiDetail.value = result['data'];
|
||||
epId = bangumiDetail.value.episodes!.first.id;
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,8 @@ class BangumiCardV extends StatelessWidget {
|
||||
'bangumiItem': res['data'],
|
||||
},
|
||||
);
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -238,6 +238,8 @@ class DynamicsController extends GetxController {
|
||||
'bangumiItem': res['data'],
|
||||
},
|
||||
);
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:PiliPalaX/common/constants.dart';
|
||||
@@ -43,6 +44,8 @@ class FavVideoCardH extends StatelessWidget {
|
||||
var result = await VideoHttp.videoIntro(bvid: bvid);
|
||||
if (result['status']) {
|
||||
epId = result['data'].epId;
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,8 @@ class HistoryItem extends StatelessWidget {
|
||||
Get.toNamed('/video?bvid=$bvid&cid=$cid',
|
||||
arguments: {'heroTag': heroTag, 'pic': videoItem.cover});
|
||||
}
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
} else {
|
||||
if (videoItem.history.epid != '') {
|
||||
@@ -120,6 +122,8 @@ class HistoryItem extends StatelessWidget {
|
||||
'bangumiItem': res['data'],
|
||||
},
|
||||
);
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +138,8 @@ Widget searchMbangumiPanel(BuildContext context, ctr, list) {
|
||||
'bangumiItem': res['data'],
|
||||
},
|
||||
);
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -118,6 +118,8 @@ class VideoIntroController extends GetxController {
|
||||
// ];
|
||||
// 获取到粉丝数再返回
|
||||
await queryUserStat();
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
if (userLogin) {
|
||||
// 获取点赞状态
|
||||
|
||||
Reference in New Issue
Block a user