地址切换

This commit is contained in:
2026-01-12 09:13:37 +08:00
parent baee5dba83
commit 285a20f070
7 changed files with 199 additions and 7 deletions

View File

@@ -28,6 +28,8 @@ class StorageService extends GetxService {
// 新增:用于标记“绑定车辆”弹窗是否已在本会话中显示过
static const String _bindDialogShownKey = 'bind_vehicle_dialog_shown';
static const String _hostUrlKey = 'host_url';
static StorageService get to => Get.find();
Future<StorageService> init() async {
@@ -36,6 +38,13 @@ class StorageService extends GetxService {
}
// --- Getters ---
String? get hostUrl => _box.read<String?>(_hostUrlKey);
///:保存自定义域名
Future<void> saveHostUrl(String url) async {
await _box.write(_hostUrlKey, url);
}
bool get isLoggedIn => _box.read<String?>(_tokenKey)?.isNotEmpty ?? false;
String? get token => _box.read<String?>(_tokenKey);