Skip to content

Commit

Permalink
fix: put_user
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnwinterLiu committed May 17, 2023
1 parent d3c031d commit eb9e5d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ apps/dgiot_customer/
apps/dgiot_cpile/
apps/dgiot_bacnet/
apps/dgiot_workshop/
apps/dgiot_yantai/
node_modules/
package-lock.json
erlang_ls.config
Expand Down
2 changes: 1 addition & 1 deletion apps/dgiot/src/utils/dgiot_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ xor_sum(B) ->
xor_sum(1, [X || <<X:8>> <= B], 0).

% 定义递归函数
xor_sum(I, List, Acc) when I < length(List) ->
xor_sum(I, List, Acc) when I =< length(List) ->
xor_sum(I + 1, List, Acc bxor lists:nth(I, List));
xor_sum(_, _, Acc) ->
Acc.
Expand Down
2 changes: 1 addition & 1 deletion apps/dgiot_parse/src/dgiot_parse_auth.erl
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ put_user(#{<<"data">> := _} = Body, SessionToken) ->
{ok, #{<<"msg">> => <<"token fail">>}}
end;
put_user(Body, SessionToken) ->
put_user_(Body, SessionToken).
{ok, put_user_(Body, SessionToken)}.

put_user_(#{<<"username">> := UserName} = Body, SessionToken) ->
case dgiot_auth:get_session(dgiot_utils:to_binary(SessionToken)) of
Expand Down

0 comments on commit eb9e5d1

Please sign in to comment.