Commit f210bad7 authored by jianglx's avatar jianglx

修改邀请码逻辑,无邀请码才请求获取邀请码

parent c0a4e338
...@@ -8,8 +8,8 @@ android { ...@@ -8,8 +8,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
flavorDimensions "default" flavorDimensions "default"
versionCode 155 versionCode 154
versionName "1.5.5" versionName "1.5.4"
multiDexEnabled true multiDexEnabled true
......
...@@ -334,20 +334,22 @@ public class MainActivity extends BaseActivity<CommonPresenter> implements DownL ...@@ -334,20 +334,22 @@ public class MainActivity extends BaseActivity<CommonPresenter> implements DownL
* 保存分享的code * 保存分享的code
*/ */
private void initShareCode() { private void initShareCode() {
ShareInstall.getInstance().getInfo(getIntent(), info -> {
// 客户端获取到的参数是json字符串格式 if (TextUtils.isEmpty(AppCookie.getStringValue("code")))
LogUtil.d("ShareInstall", "info = " + info); ShareInstall.getInstance().getInfo(getIntent(), info -> {
JSONObject object; // 客户端获取到的参数是json字符串格式
try { LogUtil.d("ShareInstall", "info = " + info);
object = new JSONObject(info); JSONObject object;
String inviteCode = object.optString("code"); try {
if (!TextUtils.isEmpty(inviteCode)) { object = new JSONObject(info);
AppCookie.save("code", inviteCode); String inviteCode = object.optString("code");
if (!TextUtils.isEmpty(inviteCode)) {
AppCookie.save("code", inviteCode);
}
} catch (JSONException e) {
e.printStackTrace();
} }
} catch (JSONException e) { });
e.printStackTrace();
}
});
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment