opt: type & grpc message (#842)

* opt: grpc type

* opt: grpc message

* opt: http type
This commit is contained in:
My-Responsitories
2025-05-10 12:40:27 +08:00
committed by GitHub
parent 7b4f08bb05
commit 024e74115e
21 changed files with 556 additions and 246 deletions

View File

@@ -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,

View File

@@ -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();
}

View File

@@ -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接口未返回数据请检查网络');
}