地址切换
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user