fix donghuoliren
This commit is contained in:
parent
e02956eed4
commit
06e901df43
@ -106,7 +106,7 @@ handle_cast({forward, LocationCode, DynamicLocationCode, EventType, Params},
|
|||||||
iot_logger:write(LoggerPid, [<<"OK">>, list_to_binary(Url1), Body, RespBody]),
|
iot_logger:write(LoggerPid, [<<"OK">>, list_to_binary(Url1), Body, RespBody]),
|
||||||
{noreply, State#state{succ_counter = SuccCounter + 1}};
|
{noreply, State#state{succ_counter = SuccCounter + 1}};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
NReason = iolist_to_binary(io_lib:format("~p", Reason)),
|
NReason = iolist_to_binary(io_lib:format("~p", [Reason])),
|
||||||
iot_logger:write(LoggerPid, [<<"ERROR">>, list_to_binary(Url1), Body, NReason]),
|
iot_logger:write(LoggerPid, [<<"ERROR">>, list_to_binary(Url1), Body, NReason]),
|
||||||
{noreply, State#state{fail_counter = FailCounter + 1}}
|
{noreply, State#state{fail_counter = FailCounter + 1}}
|
||||||
end.
|
end.
|
||||||
@ -211,7 +211,21 @@ serialize0([{K, V}|T], Target) ->
|
|||||||
is_boolean(V) andalso not V ->
|
is_boolean(V) andalso not V ->
|
||||||
<<"false">>;
|
<<"false">>;
|
||||||
is_list(V) ->
|
is_list(V) ->
|
||||||
V0 = iolist_to_binary(lists:join(<<$,>>, V)),
|
Items = lists:map(fun(E) ->
|
||||||
|
if
|
||||||
|
is_integer(E) ->
|
||||||
|
integer_to_binary(E);
|
||||||
|
is_float(E) ->
|
||||||
|
float_to_binary(E);
|
||||||
|
is_binary(E) ->
|
||||||
|
<<$", E/binary, $">>;
|
||||||
|
is_boolean(E) andalso E ->
|
||||||
|
<<"true">>;
|
||||||
|
is_boolean(E) andalso not E ->
|
||||||
|
<<"false">>
|
||||||
|
end
|
||||||
|
end, V),
|
||||||
|
V0 = iolist_to_binary(lists:join(<<$,>>, Items)),
|
||||||
<<$[, V0/binary, $]>>
|
<<$[, V0/binary, $]>>
|
||||||
end,
|
end,
|
||||||
Item = <<$", K/binary, $", $:, V1/binary>>,
|
Item = <<$", K/binary, $", $:, V1/binary>>,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user