mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: type & grpc message (#842)
* opt: grpc type * opt: grpc message * opt: http type
This commit is contained in:
committed by
GitHub
parent
7b4f08bb05
commit
024e74115e
@@ -37,9 +37,8 @@ class PageUtils {
|
||||
List<UserModel> userList = <UserModel>[];
|
||||
|
||||
final shareListRes = await ImGrpc.shareList(size: 3);
|
||||
if (shareListRes['status'] && shareListRes['data'].sessionList.isNotEmpty) {
|
||||
userList.addAll(shareListRes['data']
|
||||
.sessionList
|
||||
if (shareListRes.isSuccess && shareListRes.data.sessionList.isNotEmpty) {
|
||||
userList.addAll(shareListRes.data.sessionList
|
||||
.map<UserModel>((item) => UserModel(
|
||||
mid: item.talkerId.toInt(),
|
||||
name: item.talkerUname,
|
||||
|
||||
@@ -62,7 +62,7 @@ class RequestUtils {
|
||||
: MsgType.EN_MSG_TYPE_SHARE_V2,
|
||||
);
|
||||
|
||||
if (contentRes['status']) {
|
||||
if (contentRes.isSuccess) {
|
||||
if (message?.isNotEmpty == true) {
|
||||
var msgRes = await MsgHttp.sendMsg(
|
||||
senderUid: ownerMid,
|
||||
@@ -81,7 +81,7 @@ class RequestUtils {
|
||||
SmartDialog.showToast('分享成功');
|
||||
}
|
||||
} else {
|
||||
SmartDialog.showToast('分享失败: ${contentRes['msg']}');
|
||||
SmartDialog.showToast('分享失败: ${(contentRes as Error).errMsg}');
|
||||
}
|
||||
SmartDialog.dismiss();
|
||||
}
|
||||
|
||||
@@ -500,8 +500,8 @@ class Utils {
|
||||
if (BuildConfig.isDebug) return;
|
||||
SmartDialog.dismiss();
|
||||
try {
|
||||
dynamic res = await Request().get(Api.latestApp, extra: {'ua': 'mob'});
|
||||
if (res.data.isEmpty) {
|
||||
final res = await Request().get(Api.latestApp, uaType: 'mob');
|
||||
if (res.data is Map || res.data.isEmpty) {
|
||||
if (isAuto.not) {
|
||||
SmartDialog.showToast('检查更新失败,GitHub接口未返回数据,请检查网络');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user