Merge branch 'feature-minePage'
This commit is contained in:
@ -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';
|
||||
}
|
||||
|
@ -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'],
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user