From ef419f551c1d49d90db404d9ab1ecfb4c9169e34 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Tue, 19 Dec 2023 21:25:05 +0800 Subject: [PATCH] fix file name --- apps/iot/src/endpoint/iot_jinzhi_endpoint.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl b/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl index 3bc6192..56eb676 100644 --- a/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl +++ b/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl @@ -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),