fix: 浏览历史专栏跳转
This commit is contained in:
@ -143,7 +143,11 @@ class SearchHttp {
|
|||||||
}
|
}
|
||||||
final dynamic res =
|
final dynamic res =
|
||||||
await Request().get(Api.ab2c, data: <String, dynamic>{...data});
|
await Request().get(Api.ab2c, data: <String, dynamic>{...data});
|
||||||
return res.data['data'].first['cid'];
|
if (res.data['code'] == 0) {
|
||||||
|
return res.data['data'].first['cid'];
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> bangumiInfo(
|
static Future<Map<String, dynamic>> bangumiInfo(
|
||||||
|
|||||||
@ -43,14 +43,17 @@ class HistoryItem extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
if (videoItem.history.business.contains('article')) {
|
if (videoItem.history.business.contains('article')) {
|
||||||
int cid = videoItem.history.cid ??
|
int cid = videoItem.history.cid ??
|
||||||
// videoItem.history.oid ??
|
videoItem.history.oid ??
|
||||||
await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||||
|
if (cid == -1) {
|
||||||
|
return SmartDialog.showToast('无法获取文章内容');
|
||||||
|
}
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/webview',
|
'/read',
|
||||||
parameters: {
|
parameters: {
|
||||||
'url': 'https://www.bilibili.com/read/cv$cid',
|
'title': videoItem.title,
|
||||||
'type': 'note',
|
'id': cid.toString(),
|
||||||
'pageTitle': videoItem.title
|
'articleType': 'read',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else if (videoItem.history.business == 'live') {
|
} else if (videoItem.history.business == 'live') {
|
||||||
|
|||||||
Reference in New Issue
Block a user