👽 Update API to microservices

♻️ Refactor router pushes
This commit is contained in:
2025-07-17 14:35:09 +08:00
parent a7454edec0
commit e6c58b7b63
109 changed files with 9156 additions and 344 deletions

View File

@@ -0,0 +1,17 @@
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:island/pods/network.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'captcha.config.g.dart';
@riverpod
Future<String> captchaUrl(Ref ref) async {
final apiClient = ref.watch(apiClientProvider);
final resp = await apiClient.get('/.well-known/services');
final serviceMapping = await resp.data;
var baseUrl = serviceMapping['DysonNetwork.Pass'] as String;
// The backend using self-signed certicates on development
// Which mobile simulator might not accept, use this to avoid errors
if (baseUrl.contains('https://localhost')) baseUrl = 'http://localhost:5216';
return '$baseUrl/captcha';
}