ab share rules, use user/group name rather than level (#7443)

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2024-03-21 07:23:08 +08:00
committed by GitHub
parent 0540e2cf6c
commit 4e060203ad
3 changed files with 48 additions and 44 deletions

View File

@@ -402,7 +402,7 @@ class AbModel {
return [];
}
Future<String?> addRule(String name, int level, int rule) async {
Future<String?> addRule(String? user, String? group, int rule) async {
try {
final abGuid = current.sharedProfile()?.guid;
if (abGuid == null) {
@@ -412,9 +412,9 @@ class AbModel {
var headers = getHttpHeaders();
headers['Content-Type'] = "application/json";
final body = jsonEncode({
'ab': abGuid,
'name': name,
'level': level,
'guid': abGuid,
'user': user,
'group': group,
'rule': rule,
});
final resp =