👽 Use capital to deal with mfa

This commit is contained in:
LittleSheep 2024-08-13 10:54:42 +08:00
parent 85764c37c2
commit e9e6f3313e
3 changed files with 7 additions and 7 deletions

View File

@ -176,7 +176,7 @@ class PostEditorController extends GetxController {
visibleUsers.clear();
invisibleUsers.clear();
visibility.value = 0;
thumbnail.value = 0;
thumbnail.value = null;
publishedAt.value = null;
publishedUntil.value = null;
isDraft.value = false;

View File

@ -79,8 +79,8 @@ class _SignInPopupState extends State<SignInPopup> with ProtocolListener {
onPressed: () {
const redirect = 'solink://auth?status=done';
launchUrlString(
ServiceFinder.buildUrl('passport',
'/mfa?redirect_uri=$redirect&ticketId=${e.ticketId}'),
ServiceFinder.buildUrl('capital',
'/auth/mfa?redirect_uri=$redirect&ticketId=${e.ticketId}'),
mode: LaunchMode.inAppWebView,
);
Navigator.pop(context);

View File

@ -5,15 +5,15 @@ abstract class ServiceFinder {
static const String dealerUrl =
devFlag ? 'http://localhost:8442' : 'https://api.sn.solsynth.dev';
static const String passportUrl =
devFlag ? 'http://localhost:8444' : 'https://id.solsynth.dev';
static const String capitalUrl =
devFlag ? 'http://localhost:8444' : 'https://solsynth.dev';
static String buildUrl(String serviceName, String? append) {
append ??= '';
if (serviceName == 'dealer') {
return '$dealerUrl$append';
} else if (serviceName == 'passport') {
return '$passportUrl$append';
} else if (serviceName == 'capital') {
return '$capitalUrl$append';
}
return '$dealerUrl/cgi/$serviceName$append';
}