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