Post reactions

This commit is contained in:
2024-05-19 20:30:50 +08:00
parent 803cbd8c4b
commit 1c7077225e
10 changed files with 290 additions and 78 deletions

View File

@ -29,10 +29,7 @@ class _SignInScreenState extends State<SignInScreen> {
if (messages.last.contains('risk')) {
final ticketId = RegExp(r'ticketId=(\d+)').firstMatch(messages.last);
if (ticketId == null) {
Get.showSnackbar(GetSnackBar(
title: 'errorHappened'.tr,
message: 'requested to multi-factor authenticate, but the ticket id was not found',
));
Get.snackbar('errorHappened'.tr, 'Requested to multi-factor authenticate, but the ticket id was not found');
}
showDialog(
context: context,

View File

@ -28,14 +28,14 @@ class _SignUpScreenState extends State<SignUpScreen> {
final client = GetConnect();
client.httpClient.baseUrl = ServiceFinder.services['passport'];
final res = await client.post('/api/users', {
final resp = await client.post('/api/users', {
'name': username,
'nick': nickname,
'email': email,
'password': password,
});
if (res.statusCode == 200) {
if (resp.statusCode == 200) {
showDialog(
context: context,
builder: (context) {
@ -54,10 +54,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
AppRouter.instance.replaceNamed('auth.sign-in');
});
} else {
Get.showSnackbar(GetSnackBar(
title: 'errorHappened'.tr,
message: res.bodyString,
));
Get.snackbar('errorHappened'.tr, resp.bodyString!);
}
}