saveUserInfo static method
保存用户信息
Implementation
static Future<DataResult> saveUserInfo(
String? nickname,
String? signature,
List<UserPic>? pic,
String? birthday,
String? country,
String? gender) async {
Map other = {
'nickname': nickname,
'signature': signature,
'pic': pic,
'birthday': birthday,
'country': country,
'gender': gender
};
if (pic?.isEmpty == false) {
other['headImage'] = pic?.first.url;
}
var res = await BaseDao.fromBaseEncrypt(other, Address.saveUserInfo());
if (res.result) {
var entity = UserEntity.fromJson(res.data);
return DataResult(entity, true);
}
return res;
}