|
|
@@ -4,6 +4,7 @@ package com.sheep.gamegroup.module.login.fragments;
|
|
|
import android.support.design.widget.Snackbar;
|
|
|
import android.support.v4.app.Fragment;
|
|
|
import android.text.Editable;
|
|
|
+import android.text.TextUtils;
|
|
|
import android.text.TextWatcher;
|
|
|
import android.view.View;
|
|
|
import android.widget.EditText;
|
|
|
@@ -71,7 +72,7 @@ public class ValidCaptchaFgt extends BaseFragment {
|
|
|
|
|
|
@Override
|
|
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
- if (s!=null && s.length() == 6) {
|
|
|
+ if (s != null && s.length() == 6) {
|
|
|
submitCaptcha();
|
|
|
}
|
|
|
}
|
|
|
@@ -84,7 +85,7 @@ public class ValidCaptchaFgt extends BaseFragment {
|
|
|
countDownButton.click();
|
|
|
}
|
|
|
|
|
|
- private void submitCaptcha(){
|
|
|
+ private void submitCaptcha() {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("account", phoneNum);
|
|
|
jsonObject.put("sec_code", captchaBox.getText().toString());
|
|
|
@@ -113,8 +114,10 @@ public class ValidCaptchaFgt extends BaseFragment {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
if (loginEty != null) {
|
|
|
- SpUtils.saveToken(getActivity(), loginEty.getToken());
|
|
|
- DataUtil.getInstance().initUserEntity(loginEty.getUser());
|
|
|
+ if (TextUtils.isEmpty(SheepApp.getInstance().getGameCode())) {
|
|
|
+ SpUtils.saveToken(getActivity(), loginEty.getToken());
|
|
|
+ DataUtil.getInstance().initUserEntity(loginEty.getUser());
|
|
|
+ }
|
|
|
mController.whenLoginSuccess(LoginController.PLATFORM_PHONE, loginEty);
|
|
|
}
|
|
|
}
|
|
|
@@ -128,7 +131,7 @@ public class ValidCaptchaFgt extends BaseFragment {
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().getCaptcha(jsonObject)
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()){
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
|
|
|
@Override
|
|
|
public void onNext(BaseMessage baseMessage) {
|