From 43913ba5d3fc7984c1c2368d4e597f55ae877bb0 Mon Sep 17 00:00:00 2001 From: dawnwinterLiu <1737801684@qq.com> Date: Wed, 6 Sep 2023 21:24:40 +0800 Subject: [PATCH] fix: role --- apps/dgiot_dlink/priv/json/Amis/Amis.json | 3 +- apps/dgiot_http/etc/dgiot_http.conf | 30 +++++++++++-------- .../src/umeng/dgiot_notification.erl | 2 +- apps/dgiot_parse/src/dgiot_role.erl | 4 +-- apps/dgiot_parse/src/utils/dgiot_parse_id.erl | 9 +++--- 5 files changed, 26 insertions(+), 22 deletions(-) diff --git a/apps/dgiot_dlink/priv/json/Amis/Amis.json b/apps/dgiot_dlink/priv/json/Amis/Amis.json index 6c4649f4..433a9d86 100644 --- a/apps/dgiot_dlink/priv/json/Amis/Amis.json +++ b/apps/dgiot_dlink/priv/json/Amis/Amis.json @@ -393,7 +393,6 @@ ], "type": "tabs", "mountOnEnter": true - }, - {} + } ] } diff --git a/apps/dgiot_http/etc/dgiot_http.conf b/apps/dgiot_http/etc/dgiot_http.conf index 5858f607..147bc8bd 100644 --- a/apps/dgiot_http/etc/dgiot_http.conf +++ b/apps/dgiot_http/etc/dgiot_http.conf @@ -12,6 +12,11 @@ aliyun.accessKeySecret= WsVErdNZsfjX4PUaQZ4KkALT2Lc98o aliyun.uploadCallbackUrl= http://127.0.0.1:8081 aliyun.uploadHost= http://dgiotpump.oss-cn-shanghai.aliyuncs.com +# 阿里云工业互联网 +inplat.host = http://api.inplat.com.cn +inplat.appkey = 202308080 +inplat.appsecret = MtLbnyAgIC26czYlVPBlRO8peEAcdeSw + #百度地图 baidumap.appkey = 0twrgSghSF1Q6zUvvYdUu2KFhFiGdbm5 #百度地图纠偏值 @@ -20,28 +25,27 @@ baidumap.latoffset = 0.00000 #友盟消息推送 -umeng.appkey = 5f8bfc1780455950e4ad0482 -umeng.masterkey = ilkx2mnd2ec9u0t4h77qnx0bopy46bso +umeng.appkey = 5f8bfc13210e4ad0482 +umeng.masterkey = il312nx0bopy46bso #微信小程序 -wechat.appid = wx420c79dsac7a -wechat.secret = 5c0a80633afads96efd198161b4cda8 +wechat.appid = wx342213134584 +wechat.secret = 14a32132143ab6490ff #微信公众号 -wechatpublic.appid = wx71cffdsabdcd3 -wechatpublic.secret = 630c2cb859448fa10d9c11cedd0afc3e +wechatpublic.appid = wx3421231234bdcd3 +wechatpublic.secret = 6332142131244cedd0afc3e #服务商户号 -wechat.sp_mchid = 1641fdsa +wechat.sp_mchid = 164123456 #子商户号 -wechat.sub_mchid = 164sad335 +wechat.sub_mchid = 164123456 #商户API证书序列号 -wechat.serial_no = 314D2F0Cfdsa7BC47D6E84B7C57 - +wechat.serial_no = 3431213443505AC43223C57 #商户API v3密钥 -wechat.apiv3 = 05D4383414684fdsE898647371 +wechat.apiv3 = 8291DL3414684E9A9459KP8AYV647371 # jwt jwt.algorithm = rs256 @@ -53,5 +57,5 @@ dgiot_api.bridge_url = https://prod.dgiotcloud.cn # onenet onenet.server = https://prod.dgiotcloud.cn -onenet.appid = c95fdsaa6ec7 -onenet.secret = TTY4NDdsafdsjAyNTU1ODI4MTc5 +onenet.appid = c95cca6ec7 +onenet.secret = TTY4NDMyMTExNjAyNTU1ODI4MTc5 diff --git a/apps/dgiot_http/src/umeng/dgiot_notification.erl b/apps/dgiot_http/src/umeng/dgiot_notification.erl index 7b418378..0d5b7b3c 100644 --- a/apps/dgiot_http/src/umeng/dgiot_notification.erl +++ b/apps/dgiot_http/src/umeng/dgiot_notification.erl @@ -146,7 +146,7 @@ test_email() -> <<"from">> => <<"18257190166@163.com">>, <<"to">> => <<"344896904@qq.com">>, <<"subject">> => <<"测试邮件"/utf8>>, - <<"fromdes">> => <<"徐 <18257190166@163.com>"/utf8>>, + <<"fromdes">> => <<"刘 <18257190166@163.com>"/utf8>>, <<"todes">> => <<"刘 <344896904@qq.com>"/utf8>>, <<"data">> => <<"刘 中文测试 欢迎访问 https://github.com/dgiot "/utf8>>, <<"relay">> => <<"smtp.163.com">>, diff --git a/apps/dgiot_parse/src/dgiot_role.erl b/apps/dgiot_parse/src/dgiot_role.erl index 3c8f0c45..24fc00f6 100644 --- a/apps/dgiot_parse/src/dgiot_role.erl +++ b/apps/dgiot_parse/src/dgiot_role.erl @@ -212,7 +212,7 @@ post_role(#{<<"tempname">> := TempName, <<"parent">> := Parent, <<"depname">> := <<"roles">> => [maps:get(<<"name">>, ParentInfo)] }, create_role(Role); - {error, What} -> + {_, What} -> {error, What} end. @@ -237,7 +237,7 @@ create_role(#{<<"name">> := Name} = Role) -> {error, Reason} end; {ok, #{<<"objectId">> := RoleId}} -> - {error, #{<<"msg">> => <<"role is exist">>}} + {error, #{<<"objectId">> => RoleId, <<"msg">> => <<"role is exist">>}} end. put_role(#{<<"objectId">> := RoleId} = Role, SessionToken) -> diff --git a/apps/dgiot_parse/src/utils/dgiot_parse_id.erl b/apps/dgiot_parse/src/utils/dgiot_parse_id.erl index 959b5270..43df7da3 100644 --- a/apps/dgiot_parse/src/utils/dgiot_parse_id.erl +++ b/apps/dgiot_parse/src/utils/dgiot_parse_id.erl @@ -48,7 +48,7 @@ get_masterDataId/1, get_metaDataId/1, get_gitid/2, - get_orderid/2 + get_orderid/3 ]). @@ -88,8 +88,8 @@ get_deviceid(ProductId, DevAddr) -> DeviceId. -get_orderid(Device, Schedule) -> - <> = dgiot_utils:to_md5(<<"Order", Device/binary, Schedule/binary>>), +get_orderid(Device, Schedule, Type) -> + <> = dgiot_utils:to_md5(<<"Order", Device/binary, Schedule/binary, Type/binary>>), DId. get_userid(UserName) -> @@ -397,7 +397,8 @@ get_objectid(Class, Map) -> <<"Order">> -> #{<<"objectId">> := Device} = maps:get(<<"device">>, Map, #{<<"objectId">> => <<"">>}), #{<<"objectId">> := Schedule} = maps:get(<<"schedule">>, Map, #{<<"objectId">> => <<"">>}), - <> = dgiot_utils:to_md5(<<"Order", Device/binary, Schedule/binary>>), + Type = maps:get(<<"type">>, Map, <<>>), + <> = dgiot_utils:to_md5(<<"Order", Device/binary, Schedule/binary, Type/binary>>), Map#{ <<"objectId">> => DId };