fix
This commit is contained in:
parent
0cc1e3e542
commit
0b43bd8c13
@ -217,13 +217,13 @@ handle_event({call, From}, {attach_channel, ChannelPid}, _, State = #state{uuid
|
||||
|
||||
%% 授权通过后,才能将主机的状态设置为在线状态
|
||||
handle_event({call, From}, {create_session, PubKey}, denied, State = #state{uuid = UUID}) ->
|
||||
lager:debug("[iot_host] host_id uuid: ~p, create_session", [UUID]),
|
||||
lager:debug("[iot_host] host_id(denied) uuid: ~p, create_session, will not change host status", [UUID]),
|
||||
Reply = #{<<"a">> => false, <<"aes">> => <<"">>},
|
||||
EncReply = iot_cipher_rsa:encode(Reply, PubKey),
|
||||
{keep_state, State, [{reply, From, {ok, <<10:8, EncReply/binary>>}}]};
|
||||
|
||||
handle_event({call, From}, {create_session, PubKey}, _StateName, State = #state{uuid = UUID, aes = Aes}) ->
|
||||
lager:debug("[iot_host] host_id uuid: ~p, create_session", [UUID]),
|
||||
handle_event({call, From}, {create_session, PubKey}, StateName, State = #state{uuid = UUID, aes = Aes}) ->
|
||||
lager:debug("[iot_host] host_id(~p) uuid: ~p, create_session, will change status", [StateName, UUID]),
|
||||
Reply = #{<<"a">> => true, <<"aes">> => Aes},
|
||||
EncReply = iot_cipher_rsa:encode(Reply, PubKey),
|
||||
{ok, _} = host_bo:change_status(UUID, ?HOST_STATUS_ONLINE),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user