feat: 登录信息缓存

This commit is contained in:
guozhigq
2023-05-17 14:26:32 +08:00
parent 75ed91c29d
commit 13cecf5b84
6 changed files with 216 additions and 17 deletions

View File

@ -1,6 +1,6 @@
class Api {
// 推荐视频
static const String recommendList = '/x/web-interface/index/top/rcmd';
static const String recommendList = '/x/web-interface/index/top/feed/rcmd';
// 热门视频
static const String hotList = '/x/web-interface/popular';

View File

@ -19,8 +19,7 @@ class VideoHttp {
var res = await Request().get(
Api.recommendList,
data: {
'user-agent': Request().headerUa('mob'),
'feed_version': 'V4',
'feed_version': 'V3',
'ps': ps,
'fresh_idx': freshIdx,
},
@ -203,21 +202,20 @@ class VideoHttp {
int? root,
int? parent,
}) async {
if(message == ''){
if (message == '') {
return {'status': false, 'data': [], 'msg': '请输入评论内容'};
}
print('root:$root');
print('parent: $parent');
var res = await Request()
.post(Api.replyAdd, queryParameters: {
'type': type.index,
'oid': oid,
'root': root ?? '',
'parent': parent == null || parent == 0 ? '' : parent,
'message': message,
'csrf': await Request.getCsrf(),
});
var res = await Request().post(Api.replyAdd, queryParameters: {
'type': type.index,
'oid': oid,
'root': root ?? '',
'parent': parent == null || parent == 0 ? '' : parent,
'message': message,
'csrf': await Request.getCsrf(),
});
log(res.toString());
if (res.data['code'] == 0) {
return {'status': true, 'data': res.data['data']};