Files
zh-chat-flutter/lib/models/auth/auth_model.dart
2022-10-20 17:39:17 +08:00

28 lines
682 B
Dart

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']),
);
}