完善token重试逻辑和多设备登录

This commit is contained in:
kehaoyuan
2017-08-28 16:58:39 +08:00
parent 8e8b20c3dd
commit 0ae36ed7a7
5 changed files with 57 additions and 30 deletions

View File

@ -12,6 +12,7 @@ import com.gh.common.util.DialogUtils;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.RunningUtils;
import com.gh.common.util.ShareUtils;
import com.gh.common.util.StringUtils;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.R;
import com.gh.gamecenter.eventbus.EBShowDialog;
@ -22,6 +23,8 @@ import com.readystatesoftware.systembartint.SystemBarTintManager.SystemBarConfig
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
@ -124,6 +127,20 @@ public abstract class BaseActivity extends BaseAppCompatToolBarActivity {
}
}
});
} else if ("loginException".equals(showDialog.getType())) {
try {
JSONObject object = new JSONObject(showDialog.getPath());
JSONObject device = object.getJSONObject("device");
String manufacturer = device.getString("manufacturer");
String model = device.getString("model");
DialogUtils.showAlertDialog(this, "你的账号已在另外一台设备登录"
, StringUtils.buildString("", manufacturer, "", model, "")
, "知道了", null, null, null);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
}