|
|
@@ -217,22 +217,21 @@ public class GameCertificationActivity extends BaseActivity {
|
|
|
|
|
|
private void commitChange() {
|
|
|
if (userEntity == null) return;
|
|
|
- long expiredTime = (Long.parseLong(userEntity.getLast_login_time()) + (15 * 24 * 60 * 60)) * 1000;
|
|
|
- if (expiredTime < System.currentTimeMillis()) {
|
|
|
- Toast.makeText(this, "Token已过期,需要重新登录", Toast.LENGTH_SHORT).show();
|
|
|
- Jump2View.getInstance().goLoginViewWithoutFinish(activity, SheepApp.getInstance().getGameCode());
|
|
|
- return;
|
|
|
- }
|
|
|
- loading_view_img.setVisibility(View.VISIBLE);
|
|
|
- change_commit.setText(R.string.change_login_ing);
|
|
|
- change_commit.setEnabled(false);
|
|
|
- new Handler().postDelayed(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (!isChangeAccount)
|
|
|
- CertificationUtil.newInstance().authCertificationCode(activity, currentToken);
|
|
|
+ CommonUtil.getInstance().checkAuth(currentToken, (ret) -> {
|
|
|
+ if (ret) {
|
|
|
+ loading_view_img.setVisibility(View.VISIBLE);
|
|
|
+ change_commit.setText(R.string.change_login_ing);
|
|
|
+ change_commit.setEnabled(false);
|
|
|
+ new Handler().postDelayed(() -> {
|
|
|
+ if (!isChangeAccount) {
|
|
|
+ CertificationUtil.newInstance().authCertificationCode(activity, currentToken);
|
|
|
+ }
|
|
|
+ }, 2000);
|
|
|
+ } else {
|
|
|
+ Toast.makeText(this, "授权有效期已过,需要重新登录", Toast.LENGTH_SHORT).show();
|
|
|
+ Jump2View.getInstance().goLoginViewWithoutFinish(activity, SheepApp.getInstance().getGameCode());
|
|
|
}
|
|
|
- }, 3000);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/**
|