登录逻辑

This commit is contained in:
2022-10-21 14:03:48 +08:00
parent 30a9279ff1
commit 4bf03d234b
11 changed files with 154 additions and 135 deletions

View File

@@ -1,16 +1,12 @@
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,
@@ -18,9 +14,8 @@ class AuthModel {
});
factory AuthModel.fromJson(Map<String, dynamic> json) => AuthModel(
tokenType: json['token_type'],
accessToken: json['access_token'],
userID: json['user_id'],
userID: json['user_id'].toString(),
userSig: json['user_sig'],
userInfo: UserInfoModel.fromJson(json['user_info']),
);