完成了测试代码
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -18,7 +18,6 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@@ -19,6 +19,10 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -33,6 +33,7 @@ public class PassPortActivity extends AppCompatActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_pass_port_actvity);
|
||||
|
||||
etAppKey = findViewById(R.id.etAppKey);
|
||||
etDevicesId = findViewById(R.id.etDevicesId);
|
||||
etSignSecret = findViewById(R.id.etSignSecret);
|
||||
@@ -45,28 +46,21 @@ public class PassPortActivity extends AppCompatActivity {
|
||||
clientConfig.setThirdLogin(true);
|
||||
clientConfig.setThirdPartyAppKey("f8xx");
|
||||
clientConfig.setThirdPartyDeviceId("f8xx");
|
||||
clientConfig.setThirdPartySignSecret("f8xx");
|
||||
clientConfig.setThirdPartyAppKey("6bbe7e0e1ecd8e2f8dc336e1678a2791");
|
||||
|
||||
mMoGoAiCloudClient = MoGoAiCloudClient.getInstance().init(this,clientConfig);
|
||||
|
||||
btnRefreshToken.setOnClickListener(new View.OnClickListener() {
|
||||
btnRefreshToken.setOnClickListener(v -> mMoGoAiCloudClient.refreshToken(new IMoGoTokenCallback() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mMoGoAiCloudClient.refreshToken(new IMoGoTokenCallback() {
|
||||
@Override
|
||||
public void onTokenGot(String token, String sn) {
|
||||
tvSn.setText(sn);
|
||||
tvToken.setText(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
|
||||
}
|
||||
});
|
||||
public void onTokenGot(String token, String sn) {
|
||||
tvSn.setText(sn);
|
||||
tvToken.setText(token);
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,10 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -33,16 +33,16 @@ public class MoGoAiCloudClientConfig {
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private String thirdPartyDeviceId;
|
||||
private String thirdPartyDeviceId = "";
|
||||
/**
|
||||
* APP key
|
||||
*/
|
||||
private String thirdPartyAppKey;
|
||||
private String thirdPartyAppKey = "";
|
||||
|
||||
/**
|
||||
* 签名信息
|
||||
*/
|
||||
private String thirdPartySignSecret;
|
||||
private String thirdPartySignSecret = "";
|
||||
|
||||
/**
|
||||
* 是否是第三方登录
|
||||
@@ -52,12 +52,12 @@ public class MoGoAiCloudClientConfig {
|
||||
/**
|
||||
* 服务器分配给应用的令牌,用于网络请求校验
|
||||
*/
|
||||
String token;
|
||||
String token = "";
|
||||
|
||||
/**
|
||||
* 服务器根据设备ID 分配的SN,用于网络请求校验
|
||||
*/
|
||||
String sn;
|
||||
String sn = "";
|
||||
|
||||
public String getThirdPartyDeviceId() {
|
||||
return thirdPartyDeviceId;
|
||||
|
||||
Reference in New Issue
Block a user