fix save device errror

This commit is contained in:
lsxredrain 2021-07-19 19:02:44 +08:00
parent e4bf39eaaf
commit f7d021d20f

View File

@ -33,7 +33,7 @@ init_ets() ->
save(Device) -> save(Device) ->
DeviceId = maps:get(<<"objectId">>, Device), DeviceId = maps:get(<<"objectId">>, Device),
#{<<"objectId">> := ProductId} = maps:get(<<"product">>, Device), #{<<"objectId">> := ProductId} = maps:get(<<"product">>, Device),
#{<<"latitude">> := Latitude, <<"longitude">> := Logitude} = maps:get(<<"location">>, Device), #{<<"latitude">> := Latitude, <<"longitude">> := Logitude} = maps:get(<<"location">>, Device,#{<<"latitude">> => 0, <<"longitude">> => 0}),
Product = binary_to_atom(ProductId), Product = binary_to_atom(ProductId),
Acl = Acl =
lists:foldl(fun(X, Acc) -> lists:foldl(fun(X, Acc) ->