Commit 190b12d2203c2d7b60ef740193c272aaebd66733
1 parent
d177b23c
Exists in
yxb_dev
and in
2 other branches
no message
Showing
3 changed files
with
12 additions
and
6 deletions
Show diff stats
.idea/modules.xml
| ... | ... | @@ -4,8 +4,8 @@ |
| 4 | 4 | <modules> |
| 5 | 5 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> |
| 6 | 6 | <module fileurl="file://$PROJECT_DIR$/mvpsdk/mvpsdk.iml" filepath="$PROJECT_DIR$/mvpsdk/mvpsdk.iml" /> |
| 7 | + <module fileurl="file://$PROJECT_DIR$/parentWorkHolper.iml" filepath="$PROJECT_DIR$/parentWorkHolper.iml" /> | |
| 7 | 8 | <module fileurl="file://E:\parentwork\parentWorkHolper.iml" filepath="E:\parentwork\parentWorkHolper.iml" /> |
| 8 | - <module fileurl="file://$PROJECT_DIR$/parentwork.iml" filepath="$PROJECT_DIR$/parentwork.iml" /> | |
| 9 | 9 | <module fileurl="file://F:\parentWorkHolper\parentwork.iml" filepath="F:\parentWorkHolper\parentwork.iml" /> |
| 10 | 10 | <module fileurl="file://$PROJECT_DIR$/roundedimageview-2.2.1/roundedimageview-2.2.1.iml" filepath="$PROJECT_DIR$/roundedimageview-2.2.1/roundedimageview-2.2.1.iml" /> |
| 11 | 11 | </modules> | ... | ... |
app/src/main/java/com/shunzhi/parent/manager/MessageManager.java
| ... | ... | @@ -60,12 +60,14 @@ public class MessageManager { |
| 60 | 60 | NIMClient.getService(AuthServiceObserver.class).observeOnlineStatus(new Observer<StatusCode>() { |
| 61 | 61 | @Override |
| 62 | 62 | public void onEvent(StatusCode statusCode) { |
| 63 | - if (statusCode==StatusCode.KICKOUT){ | |
| 64 | - Intent i = new Intent(AppContext.getInstance(), LoginAndRegistActivity.class); | |
| 65 | - i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK); | |
| 63 | + if (statusCode == StatusCode.KICKOUT) { | |
| 64 | + Context context = AppContext.getInstance(); | |
| 65 | + Intent i = new Intent(context, LoginAndRegistActivity.class); | |
| 66 | + i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); | |
| 67 | + context.startActivity(i); | |
| 66 | 68 | } |
| 67 | 69 | } |
| 68 | - },true); | |
| 70 | + }, true); | |
| 69 | 71 | |
| 70 | 72 | } |
| 71 | 73 | |
| ... | ... | @@ -89,11 +91,12 @@ public class MessageManager { |
| 89 | 91 | public void onSuccess(Object o) { |
| 90 | 92 | NIMLoginResultBean bean = new NIMLoginResultBean(true, 200, null); |
| 91 | 93 | subject.onNext(bean); |
| 94 | + Timber.i("----===onSuccess : %s",o); | |
| 92 | 95 | } |
| 93 | 96 | |
| 94 | 97 | @Override |
| 95 | 98 | public void onFailed(int i) { |
| 96 | - Timber.i("------nim login failed : %s", i); | |
| 99 | + Timber.i("----===nim login failed : %s", i); | |
| 97 | 100 | ToastUtils.showToast("云信服务器登录失败:" + i); |
| 98 | 101 | NIMLoginResultBean bean = new NIMLoginResultBean(false, i, null); |
| 99 | 102 | subject.onNext(bean); |
| ... | ... | @@ -101,6 +104,7 @@ public class MessageManager { |
| 101 | 104 | |
| 102 | 105 | @Override |
| 103 | 106 | public void onException(Throwable throwable) { |
| 107 | + Timber.i("----===onException"); | |
| 104 | 108 | if (throwable != null) throwable.printStackTrace(); |
| 105 | 109 | NIMLoginResultBean bean = new NIMLoginResultBean(false, 0, throwable); |
| 106 | 110 | subject.onNext(bean); | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
| ... | ... | @@ -23,6 +23,7 @@ import java.util.regex.Pattern; |
| 23 | 23 | |
| 24 | 24 | import io.reactivex.functions.Consumer; |
| 25 | 25 | import retrofit2.HttpException; |
| 26 | +import timber.log.Timber; | |
| 26 | 27 | |
| 27 | 28 | /** |
| 28 | 29 | * Created by Administrator on 2018/3/6 0006. |
| ... | ... | @@ -45,6 +46,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
| 45 | 46 | mRxManager.register(mIModel.getLoginResult(loginName, loginPwd).subscribe(new Consumer<JsonObject>() { |
| 46 | 47 | @Override |
| 47 | 48 | public void accept(JsonObject jsonObject) throws Exception { |
| 49 | + Timber.i("---=== loginResult :%s",jsonObject); | |
| 48 | 50 | try { |
| 49 | 51 | if (jsonObject != null && !TextUtils.isEmpty(jsonObject.get("access_token").getAsString())) { |
| 50 | 52 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); | ... | ... |