Browse Source

修改登录页面部分bug

Pq 2 years ago
parent
commit
6463a059c4

+ 1 - 1
BaseLibrary/src/main/java/com/cooleshow/base/utils/ErrorParse.java

@@ -32,7 +32,7 @@ public class ErrorParse {
         if (throwable instanceof ApiException) {
             ApiException apiException = (ApiException) throwable;
             if (apiException.getErrcode() == TOKEN_INVALID_ERROR_CODE) {
-                ToastUtil.getInstance().showShort("登录状态异常,请重新登录");
+                ToastUtil.getInstance().showShort("登录过期,请重新登录");
                 logOut();
                 return;
             } else {

+ 19 - 4
usercenter/src/main/java/com/cooleshow/usercenter/ui/activity/VerifyCodeLoginActivity.java

@@ -22,6 +22,7 @@ import com.cooleshow.base.event.LoginStatusEvent;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.DeviceUtils;
+import com.cooleshow.base.utils.LogUtils;
 import com.cooleshow.base.utils.PhoneUtils;
 import com.cooleshow.base.utils.SpannableStringUtils;
 import com.cooleshow.base.utils.ToastUtil;
@@ -49,6 +50,7 @@ public class VerifyCodeLoginActivity extends BaseMVPActivity<ActivityVerifyCodeL
     public static final int STUDENT_ITEM = 2;
     private String mExtra;
     private int onDeviceClickNum = 0;//用于显示设备号
+    private String mPhoneNum;
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -63,7 +65,22 @@ public class VerifyCodeLoginActivity extends BaseMVPActivity<ActivityVerifyCodeL
     }
 
     @Override
+    protected void onNewIntent(Intent intent) {
+        super.onNewIntent(intent);
+        parseIntent(intent);
+    }
+
+    private void parseIntent(Intent intent) {
+        if (intent != null) {
+            mExtra = intent.getStringExtra(Constants.COMMON_EXTRA_KEY);
+            LogUtils.i("pq", "login mExtra:" + mExtra);
+            mPhoneNum = intent.getStringExtra(UserConstants.PHONE_NUM_KEY);
+        }
+    }
+
+    @Override
     protected void initView() {
+        parseIntent(getIntent());
         if (BaseApplication.Companion.isTeacherClient()) {
             viewBinding.tvHeaderTitle.setText("您好, \n欢迎使用酷乐秀学院");
         } else {
@@ -72,10 +89,8 @@ public class VerifyCodeLoginActivity extends BaseMVPActivity<ActivityVerifyCodeL
         viewBinding.tvSendVerifyCode.setOnClickListener(this);
         viewBinding.tvLoginByCode.setOnClickListener(this);
         viewBinding.viewDeviceView.setOnClickListener(this);
-        mExtra = getIntent().getStringExtra(Constants.COMMON_EXTRA_KEY);
-        String phoneNum = getIntent().getStringExtra(UserConstants.PHONE_NUM_KEY);
-        if (!TextUtils.isEmpty(phoneNum)) {
-            viewBinding.etPhoneNum.setText(phoneNum);
+        if (!TextUtils.isEmpty(mPhoneNum)) {
+            viewBinding.etPhoneNum.setText(mPhoneNum);
         }
 //        if (UserHelper.getAppPrivacyMode() == 1) {
 //            //已同意隐私协议及用户协议