Parcourir la source

Merge remote-tracking branch 'origin/sheep_develop' into sheep_develop

zengjiebin il y a 7 ans
Parent
commit
4e8f000585
1 fichiers modifiés avec 18 ajouts et 18 suppressions
  1. 18 18
      app/src/main/java/com/sheep/gamegroup/module/login/LoginAct.java

+ 18 - 18
app/src/main/java/com/sheep/gamegroup/module/login/LoginAct.java

@@ -58,8 +58,8 @@ public class LoginAct extends BaseUMActivity implements LoginController {
     public void initView() {
         TitleBarUtils.getInstance().setTitleBack(this);
 //        if (DDProviderHelper.getInstance().getAccountList().size() == 0) {
-            WelcomeFgt welcomeFragment = WelcomeFgt.newInstance(this);
-            showFragment("welcome", welcomeFragment);
+        WelcomeFgt welcomeFragment = WelcomeFgt.newInstance(this);
+        showFragment("welcome", welcomeFragment);
 //        } else {
 //            SignInFgt signInFragment = SignInFgt.newInstance(this);
 //            showFragment("登录", signInFragment);
@@ -79,8 +79,8 @@ public class LoginAct extends BaseUMActivity implements LoginController {
         if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
             TitleBarUtils.getInstance().setShowOrHide(this, false);
         }
-        if(getSupportActionBar()!=null){
-            if(getSupportFragmentManager().getBackStackEntryCount() == 1) {
+        if (getSupportActionBar() != null) {
+            if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
                 getSupportActionBar().hide();
             } else {
                 getSupportActionBar().show();
@@ -97,17 +97,12 @@ public class LoginAct extends BaseUMActivity implements LoginController {
 
     @Override
     public void whenLoginSuccess(int platform, LoginEntity loginResult) {
-        if (TextUtils.isEmpty(SheepApp.getInstance().getGameCode())) {
 //            Snackbar.make(getWindow().getDecorView(), "登录成功", Snackbar.LENGTH_SHORT).show();
-            if (TextUtils.isEmpty(loginResult.getUser().getBirthday())
-                    || loginResult.getUser().getBirthday().startsWith("000")) {
-                getUserInfo(platform, loginResult);
-            } else {
-                goMain(loginResult);
-            }
+        if (TextUtils.isEmpty(loginResult.getUser().getBirthday())
+                || loginResult.getUser().getBirthday().startsWith("000")) {
+            getUserInfo(platform, loginResult);
         } else {
-            CertificationUtil.newInstance().addCurUserToSdkLoginUser();
-            CertificationUtil.newInstance().authCertificationCode(this, SpUtils.getToken(SheepApp.getInstance()));
+            goMain(loginResult);
         }
         TestUtil.saveUser(loginResult);
         if (platform == LoginController.PLATFORM_ACCOUNT || platform == LoginController.PLATFORM_PHONE) {
@@ -161,9 +156,14 @@ public class LoginAct extends BaseUMActivity implements LoginController {
         goMain(entity);
     }
 
-    private void goMain(LoginEntity entity){
-        showProgress();
-        Jump2View.getInstance().checkOrGoHomePage(this);
+    private void goMain(LoginEntity entity) {
+        CertificationUtil.newInstance().addCurUserToSdkLoginUser();
+        if (TextUtils.isEmpty(SheepApp.getInstance().getGameCode())) {
+            showProgress();
+            Jump2View.getInstance().checkOrGoHomePage(this);
+        } else {
+            CertificationUtil.newInstance().authCertificationCode(this, SpUtils.getToken(SheepApp.getInstance()));
+        }
     }
 
     @Override
@@ -185,8 +185,8 @@ public class LoginAct extends BaseUMActivity implements LoginController {
     }
 
     private void showFragment(String tag, Fragment fragment) {
-        if(getSupportActionBar()!=null){
-            if(getSupportFragmentManager().getBackStackEntryCount() > 0) {
+        if (getSupportActionBar() != null) {
+            if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
                 getSupportActionBar().show();
             } else {
                 getSupportActionBar().hide();