fix file name

This commit is contained in:
anlicheng 2023-12-19 21:25:05 +08:00
parent 3aa1567611
commit ef419f551c

View File

@ -180,8 +180,9 @@ do_post(#event_data{id = Id, location_code = LocationCode, event_type = EventTyp
% <<"occurrenceTime">> => <<"2023-06-10 12:00:00">>,
Attachments = lists:map(fun(#{<<"filename">> := Filename, <<"name">> := Name}) ->
Attachments = lists:map(fun(#{<<"filename">> := Filename}) ->
{ok, FileUrl} = iot_util:file_uri(Filename),
Name = filename:basename(FileUrl),
#{<<"name">> => Name, <<"url">> => FileUrl}
end, Attachments0),