loginByApple method
通过Apple账号登录
Implementation
Future<EasyPacket<void>> loginByApple({required String appleUid, required String appleUname, required String authorizationCode, String? identityToken}) async {
final response = await _guestClient.httpRequest('$host/loginByApple', data: {'bsid': bsid, 'appleUid': appleUid, 'appleUname': appleUname, 'authorizationCode': authorizationCode, 'identityToken': identityToken});
if (response.ok) {
user.updateByJson(response.data!['user']);
_resetAliveClient(response.data!['url'], response.data!['pwd']);
onCredentials(ComTools.formatUserNick(user), encryptCredentials(user, secret));
} else if (response.code == 401) {
onCredentials(ComTools.formatUserNick(user), null);
}
return response;
}