This commit is contained in:
2022-10-20 17:39:17 +08:00
parent 0a81762ba1
commit 30a9279ff1
8 changed files with 134 additions and 18 deletions

View File

@@ -0,0 +1,27 @@
import 'package:chat/models/user_info_model.dart';
class AuthModel {
String tokenType;
String accessToken;
String userSig;
String userID;
UserInfoModel userInfo;
String get userToken => '$tokenType $accessToken';
AuthModel({
required this.tokenType,
required this.accessToken,
required this.userID,
required this.userSig,
required this.userInfo,
});
factory AuthModel.fromJson(Map<String, dynamic> json) => AuthModel(
tokenType: json['token_type'],
accessToken: json['access_token'],
userID: json['user_id'],
userSig: json['user_sig'],
userInfo: UserInfoModel.fromJson(json['user_info']),
);
}