[master] update sn and token get
This commit is contained in:
@@ -113,12 +113,12 @@ public class MoGoAiCloudClientConfig {
|
||||
/**
|
||||
* 服务器分配给应用的令牌,用于网络请求校验
|
||||
*/
|
||||
private String token = "";
|
||||
private volatile String token = "";
|
||||
|
||||
/**
|
||||
* 服务器根据设备ID 分配的SN,用于网络请求校验
|
||||
*/
|
||||
private String sn = "";
|
||||
private volatile String sn = "";
|
||||
|
||||
/**
|
||||
* 是否为高精定位设备
|
||||
@@ -305,6 +305,9 @@ public class MoGoAiCloudClientConfig {
|
||||
* @return Token信息
|
||||
*/
|
||||
public String getToken() {
|
||||
if (token != null && !token.isEmpty()) {
|
||||
return token;
|
||||
}
|
||||
if (TextUtils.isEmpty(SpStorage.getToken())) {
|
||||
Log.e(TAG, "本地 Token 获取失败……");
|
||||
}
|
||||
@@ -317,6 +320,9 @@ public class MoGoAiCloudClientConfig {
|
||||
* @return SN信息
|
||||
*/
|
||||
public String getSn() {
|
||||
if (sn != null && !sn.isEmpty()) {
|
||||
return sn;
|
||||
}
|
||||
if (TextUtils.isEmpty(SpStorage.getSn())) {
|
||||
Log.e(TAG, "本地 SN 获取失败……");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user