|
|
@@ -0,0 +1,44 @@ |
|
|
|
|
|
|
|
/// |
|
|
|
/// 用户信息类 |
|
|
|
/// |
|
|
|
class UserInfoModel { |
|
|
|
String token; |
|
|
|
String mobile; |
|
|
|
String userId; |
|
|
|
String username; |
|
|
|
List<String> perms; |
|
|
|
String registerInviteCodeEnable; |
|
|
|
|
|
|
|
UserInfoModel( |
|
|
|
{this.token, |
|
|
|
this.userId, |
|
|
|
this.username, |
|
|
|
this.perms, |
|
|
|
this.registerInviteCodeEnable}); |
|
|
|
|
|
|
|
UserInfoModel.fromJson(Map<String, dynamic> json) { |
|
|
|
token = json['token']; |
|
|
|
userId = json['user_id']; |
|
|
|
username = json['username']; |
|
|
|
mobile = json['mobile']; |
|
|
|
perms = json['perms']?.cast<String>(); |
|
|
|
registerInviteCodeEnable = json['register_invite_code_enable']; |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, dynamic> toJson() { |
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>(); |
|
|
|
data['token'] = this.token; |
|
|
|
data['user_id'] = this.userId; |
|
|
|
data['username'] = this.username; |
|
|
|
data['perms'] = this.perms; |
|
|
|
data['mobile'] = this.mobile; |
|
|
|
data['register_invite_code_enable'] = this.registerInviteCodeEnable; |
|
|
|
return data; |
|
|
|
} |
|
|
|
|
|
|
|
@override |
|
|
|
String toString() { |
|
|
|
return 'LoginUser{token: $token, userId: $userId, username: $username, perms: $perms, registerInviteCodeEnable: $registerInviteCodeEnable}'; |
|
|
|
} |
|
|
|
} |