This commit is contained in:
anlicheng 2026-04-02 16:34:59 +08:00
parent 86effab931
commit 681ac70d10

View File

@ -36,7 +36,7 @@ handle_request("POST", "/network/delete", _, #{<<"id">> := NetworkId}) when Netw
end
end;
handle_request("POST", "/network/exit_node_control", _, #{<<"id">> := NetworkId, <<"action">> := Action, <<"dst_mac">> := DstMac, <<"remark">> := Remark, <<"timeout">> := Timeout}) when NetworkId > 0 ->
handle_request("POST", "/network/exit_node_control", _, #{<<"id">> := NetworkId, <<"action">> := Action, <<"dst_mac">> := DstMac0, <<"remark">> := Remark, <<"timeout">> := Timeout}) when NetworkId > 0 ->
case sdlan_network:get_pid(NetworkId) of
undefined ->
{ok, 200, sdlan_util:json_data(<<"network not found">>)};
@ -46,6 +46,7 @@ handle_request("POST", "/network/exit_node_control", _, #{<<"id">> := NetworkId,
action = Action,
remark = Remark
}},
DstMac = sdlan_util:mac_str_to_bin(DstMac0),
case sdlan_network:command(NetworkId, ReceiverPid, DstMac, SubCommand) of
{error, Reason} ->
{ok, 200, sdlan_util:json_error(-1, Reason)};