mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: reply err msg
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -112,6 +112,8 @@ class GrpcRepo {
|
||||
e.details?.firstOrNull?.getFieldOrNull(2),
|
||||
allowMalformed: true,
|
||||
);
|
||||
msg = msg.replaceAll(
|
||||
RegExp(r"[^a-zA-Z0-9\u4e00-\u9fa5,.;!?,。;!?]"), '');
|
||||
if (msg.isNotEmpty) {
|
||||
return {'status': false, 'msg': msg};
|
||||
} else {
|
||||
|
||||
@@ -64,7 +64,8 @@ class ReplyHttp {
|
||||
if (res['status']) {
|
||||
return LoadingState.success(res['data']);
|
||||
} else {
|
||||
return LoadingState.error(res['msg']);
|
||||
return LoadingState.error(
|
||||
'${res['msg'].startsWith('gRPC Error') ? '如无法加载评论:\n关闭代理\n或设置中关闭使用gRPC加载评论\n\n' : ''}${res['msg']}');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,13 +40,12 @@ class FavVideoCardH extends StatelessWidget {
|
||||
onTap!();
|
||||
return;
|
||||
}
|
||||
int? seasonId;
|
||||
String? epId;
|
||||
if (videoItem.ogv != null &&
|
||||
(videoItem.ogv['type_name'] == '番剧' ||
|
||||
videoItem.ogv['type_name'] == '国创')) {
|
||||
videoItem.cid = await SearchHttp.ab2c(bvid: bvid);
|
||||
seasonId = videoItem.ogv['season_id'];
|
||||
dynamic seasonId = videoItem.ogv['season_id'];
|
||||
epId = videoItem.epId;
|
||||
Utils.viewBangumi(seasonId: seasonId, epId: epId);
|
||||
return;
|
||||
@@ -63,7 +62,6 @@ class FavVideoCardH extends StatelessWidget {
|
||||
'bvid': bvid,
|
||||
'cid': videoItem.cid.toString(),
|
||||
'epId': epId ?? '',
|
||||
if (seasonId != null) 'seasonId': seasonId.toString(),
|
||||
};
|
||||
// if (seasonId != null) {
|
||||
// parameters['seasonId'] = seasonId.toString();
|
||||
|
||||
@@ -277,8 +277,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
callback: _videoReplyController.onReload,
|
||||
),
|
||||
Error() => HttpError(
|
||||
errMsg:
|
||||
'如无法加载评论:\n1.关闭代理\n2.设置中关闭使用gRPC加载评论\n\n${loadingState.errMsg}',
|
||||
errMsg: loadingState.errMsg,
|
||||
callback: _videoReplyController.onReload,
|
||||
),
|
||||
LoadingState() => throw UnimplementedError(),
|
||||
|
||||
Reference in New Issue
Block a user