Skip to content

Commit

Permalink
router
Browse files Browse the repository at this point in the history
  • Loading branch information
AvantLiu committed Aug 26, 2021
1 parent d707f84 commit 6aedca2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions apps/dgiot_api/src/rest/dgiot_router.erl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ init(Req0, {swagger, Name} = Opts) ->

%% install
init(Req0, install) ->
io:format("Req0 install ~p",[Req0]),
Product = dgiot_req:binding(<<"Product">>, Req0),
#{peer := {IpPeer, _}} = Req0,
Req =
Expand All @@ -193,7 +192,6 @@ init(Req0, install) ->
{ok, Name} = dgiot_data:lookup({Port, httpd}),
case catch (dgiot_install:start(#{product => Product, webserver => Name})) of
{Type, Reason} when Type == 'EXIT'; Type == error ->
?LOG(info,"Reason ~p ", [Reason]),
dgiot_req:reply(500, ?HEADER#{
<<"content-type">> => <<"application/json; charset=utf-8">>
}, jsx:encode(#{error => list_to_binary(io_lib:format("~p", [Reason]))}), Req0);
Expand Down
2 changes: 0 additions & 2 deletions apps/dgiot_api/src/utils/dgiot_install.erl
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,7 @@ generate_users(Result) ->

%% 权限入库
generate_rule(Result) ->
?LOG(info,"Result ~p",[Result]),
#{name := ServerName} = proplists:get_value(<<"webname">>, Result, #{name => dgiot_rest}),
?LOG(info,"ServerName ~p",[ServerName]),
Rules =
case dgiot_swagger:read(ServerName, #{}) of
{ok, Schema} ->
Expand Down

0 comments on commit 6aedca2

Please sign in to comment.