@@ -37,7 +37,6 @@ public class ELoginActivity extends AppCompatActivity {
37
37
public static final String LOGO_INFO = "com.reactnativegeyan.eloginactivity.logo" ;
38
38
public static final String PRIVACY_INFO = "com.reactnativegeyan.eloginactivity.privacy" ;
39
39
private static final String TAG = ELoginActivity .class .getSimpleName ();
40
- private boolean isBack = false ;
41
40
private CheckBox mCheckbox ;
42
41
private ProgressDialog dialog ;
43
42
@ Override
@@ -47,13 +46,12 @@ public void onCreate(Bundle saveInstanceState) {
47
46
ViewUtil .setStatusBarLightMode (true , this );
48
47
setContentView (R .layout .activity_elogin );
49
48
Toolbar toolbar = (Toolbar ) findViewById (R .id .toolbar );
50
- toolbar .setNavigationOnClickListener ((v ) -> { onBackPressed (); isBack = true ; });
49
+ toolbar .setNavigationOnClickListener ((v ) -> { onBackPressed (); });
51
50
ImageView imageView = (ImageView ) findViewById (R .id .logo_imageview );
52
51
String logo = getIntent ().getStringExtra (LOGO_INFO );
53
52
Glide .with (this ).load (logo ).into (imageView );
54
53
elogin ();
55
54
}
56
-
57
55
private void elogin () {
58
56
TextView numberTv = findViewById (R .id .number_textview );
59
57
TextView sloganTv = findViewById (R .id .slogan_textview );
@@ -108,9 +106,14 @@ public void onSuccess(GYResponse gyResponse) {
108
106
109
107
@ Override
110
108
public void onFailed (GYResponse gyResponse ) {
111
- // 路由返回时不弹出框
112
- if (!isBack ) {
113
- showToast ("一键登录失败:" + gyResponse .getMsg ());
109
+ try {
110
+ JSONObject jsonObject = new JSONObject (gyResponse .getMsg ());
111
+ int errorCode = jsonObject .getInt ("errorCode" );
112
+ if (errorCode != -20301 ) {
113
+ showToast ("一键登录失败:" + gyResponse .getMsg ());
114
+ }
115
+ } catch (Exception e ) {
116
+ e .printStackTrace ();
114
117
}
115
118
hideDialog ();
116
119
finish ();
0 commit comments