1.还原授权页 UI
2.还原扫码页 UI
This commit is contained in:
@@ -50,8 +50,13 @@ class AuthViewModel extends StateNotifier<AuthState> {
|
||||
Future<bool> parseTokenSetState(String token) async {
|
||||
final decoded = JwtDecoder.decode(token);
|
||||
if (decoded['data'] != null && decoded['data'] is Map<String, dynamic>) {
|
||||
final data = JwtDecodedData.fromJson(decoded['data']);
|
||||
state = state.copyWith(jwtDecodedData: data);
|
||||
try {
|
||||
final data = JwtDecodedData.fromJson(decoded['data']);
|
||||
state = state.copyWith(jwtDecodedData: data);
|
||||
} catch (error) {
|
||||
state = const AuthState(errorMessage: '认证失败,请重试');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user