LighthouseApp/lib/singbox/model/warp_account.dart
speakeloudest 75d4c48e41
Some checks failed
Build Windows / build (push) Has been cancelled
feat: 源码提交
2025-10-19 23:30:54 -07:00

27 lines
610 B
Dart
Executable File

import 'dart:convert';
typedef WarpResponse = ({
String log,
String accountId,
String accessToken,
String wireguardConfig,
});
WarpResponse warpFromJson(dynamic json) {
if (json
case {
"account-id": final String newAccountId,
"access-token": final String newAccessToken,
"log": final String log,
"config": final Map<String, dynamic> wireguardConfig,
}) {
return (
log: log,
accountId: newAccountId,
accessToken: newAccessToken,
wireguardConfig: jsonEncode(wireguardConfig),
);
}
throw Exception("invalid response");
}