fix(api): fix ee call module api 404

This commit is contained in:
Turtle 2021-06-04 19:41:57 +08:00 committed by turtleDeng
parent 6f2407d5d9
commit f682bfe6e0
2 changed files with 10 additions and 26 deletions

View File

@ -1,34 +1,12 @@
%% -*- mode: erlang -*- %% -*- mode: erlang -*-
{VSN, {VSN,
[ {"4.3.2", [ {<<"4.3.[0-2]">>,
[ {load_module, emqx_mgmt, brutal_purge, soft_purge, []} [ {restart_application, emqx_management}
, {load_module, emqx_mgmt_api_data, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_api, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_api_clients, brutal_purge, soft_purge, []}
]},
{<<"4.3.[0-1]">>,
[ {load_module, emqx_mgmt_data_backup, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_cli, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_api_data, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_api, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_api_clients, brutal_purge, soft_purge, []}
]}, ]},
{<<".*">>, []} {<<".*">>, []}
], ],
[ {"4.3.2", [ {<<"4.3.[0-2]">>,
[ {load_module, emqx_mgmt, brutal_purge, soft_purge, []} [ {restart_application, emqx_management}
, {load_module, emqx_mgmt_api_data, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_api, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_api_clients, brutal_purge, soft_purge, []}
]},
{<<"4.3.[0-1]">>,
[ {load_module, emqx_mgmt_data_backup, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_cli, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_api_data, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_api, brutal_purge, soft_purge, []}
, {load_module, emqx_mgmt_api_clients, brutal_purge, soft_purge, []}
]}, ]},
{<<".*">>, []} {<<".*">>, []}
] ]

View File

@ -119,12 +119,18 @@ authorize_appid(Req) ->
_ -> false _ -> false
end. end.
-ifdef(EMQX_ENTERPRISE).
filter(_) ->
true.
-else.
filter(#{app := emqx_modules}) -> true; filter(#{app := emqx_modules}) -> true;
filter(#{app := App}) -> filter(#{app := App}) ->
case emqx_plugins:find_plugin(App) of case emqx_plugins:find_plugin(App) of
false -> false; false -> false;
Plugin -> Plugin#plugin.active Plugin -> Plugin#plugin.active
end. end.
-endif.
format(Port) when is_integer(Port) -> format(Port) when is_integer(Port) ->
io_lib:format("0.0.0.0:~w", [Port]); io_lib:format("0.0.0.0:~w", [Port]);