@@ -59,14 +59,12 @@ class WhitelistEntry {
5959 factory WhitelistEntry .fromJson (Map <String , dynamic > json) => WhitelistEntry (
6060 ip: json['ip' ] as String ? ?? '' ,
6161 nickname: json['nickname' ] as String ? ?? '' ,
62- allowedModelCardIds: (json[ 'allowedModelCardIds' ] as List ? )
63- ? .cast <String >() ?? const [],
62+ allowedModelCardIds:
63+ (json[ 'allowedModelCardIds' ] as List ? ) ? .cast <String >() ?? const [],
6464 mcpEnabled: json['mcpEnabled' ] as bool ? ?? false ,
65- mcpServerIds: (json['mcpServerIds' ] as List ? )
66- ? .cast <String >() ?? const [],
65+ mcpServerIds: (json['mcpServerIds' ] as List ? )? .cast <String >() ?? const [],
6766 skillEnabled: json['skillEnabled' ] as bool ? ?? false ,
68- skillIds: (json['skillIds' ] as List ? )
69- ? .cast <String >() ?? const [],
67+ skillIds: (json['skillIds' ] as List ? )? .cast <String >() ?? const [],
7068 searchProvider: json['searchProvider' ] as String ? ?? 'none' ,
7169 );
7270}
@@ -117,9 +115,11 @@ class OnlineServiceConfig {
117115 port: json['port' ] as int ? ?? 2002 ,
118116 maxConnections: json['maxConnections' ] as int ? ?? 5 ,
119117 accepting: json['accepting' ] as bool ? ?? true ,
120- whitelist: (json['whitelist' ] as List ? )
121- ? .map ((e) => WhitelistEntry .fromJson (e as Map <String , dynamic >))
122- .toList () ?? const [],
118+ whitelist:
119+ (json['whitelist' ] as List ? )
120+ ? .map ((e) => WhitelistEntry .fromJson (e as Map <String , dynamic >))
121+ .toList () ??
122+ const [],
123123 );
124124
125125 /// 持久化路径
@@ -167,7 +167,9 @@ class OnlineServiceConfig {
167167 }
168168 // 通配符: "192.168.1.*"
169169 if (pattern.contains ('*' )) {
170- final regex = RegExp ('^${pattern .replaceAll ('.' , r'\.' ).replaceAll ('*' , r'\d+' )}' );
170+ final regex = RegExp (
171+ '^${pattern .replaceAll ('.' , r'\.' ).replaceAll ('*' , r'\d+' )}' ,
172+ );
171173 return regex.hasMatch (clientIp);
172174 }
173175 return false ;
0 commit comments