Merge branch 'feature-minePage'

This commit is contained in:
guozhigq
2024-10-20 22:49:19 +08:00
19 changed files with 848 additions and 736 deletions

View File

@ -593,6 +593,12 @@ class Api {
static const String liveRoomEntry =
'${HttpString.liveBaseUrl}/xlive/web-room/v1/index/roomEntryAction';
/// 用户信息
static const String accountInfo = '/x/member/web/account';
/// 更新用户信息
static const String updateAccountInfo = '/x/member/web/update';
/// 删除评论
static const String replyDel = '/x/v2/reply/del';
}

View File

@ -1,4 +1,6 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:html/parser.dart';
import 'package:pilipala/models/video/later.dart';
import '../models/model_hot_video_item.dart';
@ -465,4 +467,53 @@ class UserHttp {
.toList()
};
}
static Future getAccountInfo() async {
var res = await Request().get(
Api.accountInfo,
data: {'web_location': 333.33},
);
if (res.data['code'] == 0) {
return {
'status': true,
'data': res.data['data'],
};
} else {
return {
'status': false,
'data': {},
'mag': res.data['message'],
};
}
}
static Future updateAccountInfo({
required String uname,
required String sign,
required String sex,
required String birthday,
}) async {
var res = await Request().post(
Api.updateAccountInfo,
data: {
'uname': uname,
'usersign': sign,
'sex': sex,
'birthday': birthday,
'csrf': await Request.getCsrf(),
},
options: Options(contentType: Headers.formUrlEncodedContentType),
);
if (res.data['code'] == 0) {
return {
'status': true,
'msg': '更新成功',
};
} else {
return {
'status': false,
'msg': res.data['message'],
};
}
}
}