diff --git a/foudations/mogo-network/src/main/java/com/mogo/cloud/network/interceptor/HttpHeaderInterceptor.kt b/foudations/mogo-network/src/main/java/com/mogo/cloud/network/interceptor/HttpHeaderInterceptor.kt index a0ba4b2..1727c4b 100644 --- a/foudations/mogo-network/src/main/java/com/mogo/cloud/network/interceptor/HttpHeaderInterceptor.kt +++ b/foudations/mogo-network/src/main/java/com/mogo/cloud/network/interceptor/HttpHeaderInterceptor.kt @@ -20,8 +20,8 @@ class HttpHeaderInterceptor : Interceptor { .header("sn",MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn) .method(original.method(), original.body()) .build() - if(MoGoAiCloudClient.getInstance().aiCloudClientConfig.authPubKey.isNotBlank()){ - request = request.newBuilder().header("authKey",MoGoAiCloudClient.getInstance().aiCloudClientConfig.authPubKey).build() + if(MoGoAiCloudClient.getInstance().aiCloudClientConfig.securityKey.isNotBlank()){ + request = request.newBuilder().header("authKey",MoGoAiCloudClient.getInstance().aiCloudClientConfig.securityKey).build() } return chain.proceed(request) } diff --git a/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClient.java b/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClient.java index 6ef0f02..3c54140 100644 --- a/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClient.java +++ b/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClient.java @@ -99,7 +99,9 @@ public class MoGoAiCloudClient { @Override public void onError(int code, String msg) { - Toast.makeText(mContext, "MoGo鉴权失败", Toast.LENGTH_SHORT).show(); + if(mAiCloudClientConfig.isShowToastLog()){ + Toast.makeText(mContext, "MoGo鉴权失败", Toast.LENGTH_SHORT).show(); + } Log.e(TAG, "═════════════════════════════════════"); Log.e(TAG, "║ MoGo鉴权失败 "); Log.e(TAG, "║ ErrorCode:" + code); diff --git a/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java b/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java index 4d0e4bf..ec8fc15 100644 --- a/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java +++ b/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java @@ -53,7 +53,7 @@ public class MoGoAiCloudClientConfig { */ private String thirdPartyDeviceId = ""; /** - * APP key + * passport APP key */ private String thirdPartyAppKey = ""; /** @@ -64,6 +64,11 @@ public class MoGoAiCloudClientConfig { // 必传, Socket长链接时做校验 private String secretKey = ""; + /** + * 应用安全校验值,用于header + */ + private String securityKey = ""; + /** * 签名信息 */ @@ -213,6 +218,14 @@ public class MoGoAiCloudClientConfig { this.secretKey = secretKey; } + public String getSecurityKey() { + return securityKey; + } + + public void setSecurityKey(String securityKey) { + this.securityKey = securityKey; + } + /** * 获取AI云平台分配给三方应用的签名密钥,需要从AI云平台申请 * @@ -503,6 +516,7 @@ public class MoGoAiCloudClientConfig { ", thirdPartyAppKey='" + thirdPartyAppKey + '\'' + ", authPubKey='" + authPubKey + '\'' + ", secretKey='" + secretKey + '\'' + + ", securityKey='" + securityKey + '\'' + ", thirdPartySignSecret='" + thirdPartySignSecret + '\'' + ", thirdLogin=" + thirdLogin + ", passportUrl='" + passportUrl + '\'' + diff --git a/gradle.properties b/gradle.properties index 3591076..1614b09 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,24 +36,24 @@ PASSWORD=xintai2018 RELEASE=true # AI CLOUD 云平台 # 工具类 -MOGO_UTILS_VERSION=1.4.7.11 +MOGO_UTILS_VERSION=1.4.7.12 # 网络请求 -MOGO_NETWORK_VERSION=1.4.7.11 +MOGO_NETWORK_VERSION=1.4.7.12 # 鉴权 -MOGO_PASSPORT_VERSION=1.4.7.11 +MOGO_PASSPORT_VERSION=1.4.7.12 # 常链接 -MOGO_SOCKET_VERSION=1.4.7.11 +MOGO_SOCKET_VERSION=1.4.7.12 # 数据采集 -MOGO_REALTIME_VERSION=1.4.7.11 +MOGO_REALTIME_VERSION=1.4.7.12 # 探路,道路事件发布,获取 -MOGO_TANLU_VERSION=1.4.7.11 +MOGO_TANLU_VERSION=1.4.7.12 # 直播推流 -MOGO_LIVE_VERSION=1.4.7.11 +MOGO_LIVE_VERSION=1.4.7.12 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.4.7.11 +MOGO_TRAFFICLIVE_VERSION=1.4.7.12 # 定位服务 -MOGO_LOCATION_VERSION=1.4.7.11 +MOGO_LOCATION_VERSION=1.4.7.12 # 远程通讯模块 -MOGO_TELEMATIC_VERSION=1.4.7.11 +MOGO_TELEMATIC_VERSION=1.4.7.12 # v2x -MOGO_V2X_VERSION=1.4.7.11 +MOGO_V2X_VERSION=1.4.7.12