Commit 0e9edef2b0dd448ade4ac720c29438cef8302557
1 parent
2e560dbc
Exists in
yxb_dev
and in
2 other branches
no message
Showing
6 changed files
with
25 additions
and
5 deletions
Show diff stats
app/build.gradle
| 1 | apply plugin: 'com.android.application' | 1 | apply plugin: 'com.android.application' |
| 2 | +apply plugin: 'org.greenrobot.greendao' // apply plugin | ||
| 2 | 3 | ||
| 3 | android { | 4 | android { |
| 4 | signingConfigs { | 5 | signingConfigs { |
| @@ -43,4 +44,5 @@ dependencies { | @@ -43,4 +44,5 @@ dependencies { | ||
| 43 | implementation project(':mvpsdk') | 44 | implementation project(':mvpsdk') |
| 44 | implementation project(':roundedimageview-2.2.1') | 45 | implementation project(':roundedimageview-2.2.1') |
| 45 | implementation files('libs/AMap_Location_V3.8.0_20180201.jar') | 46 | implementation files('libs/AMap_Location_V3.8.0_20180201.jar') |
| 47 | + implementation 'org.greenrobot:greendao:3.2.2' // add library | ||
| 46 | } | 48 | } |
app/proguard-rules.pro
| @@ -19,3 +19,10 @@ | @@ -19,3 +19,10 @@ | ||
| 19 | # If you keep the line number information, uncomment this to | 19 | # If you keep the line number information, uncomment this to |
| 20 | # hide the original source file name. | 20 | # hide the original source file name. |
| 21 | #-renamesourcefileattribute SourceFile | 21 | #-renamesourcefileattribute SourceFile |
| 22 | +-keepclassmembers class * extends org.greenrobot.greendao.AbstractDao { | ||
| 23 | +public static java.lang.String TABLENAME; | ||
| 24 | +} | ||
| 25 | +-keep class **$Properties | ||
| 26 | + | ||
| 27 | +# If you do not use SQLCipher: | ||
| 28 | +-dontwarn org.greenrobot.greendao.database.** |
app/src/main/java/com/shunzhi/parent/bean/message/PHMessage.java
0 → 100644
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
| @@ -46,13 +46,12 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -46,13 +46,12 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
| 46 | mRxManager.register(mIModel.getLoginResult(loginName, loginPwd).subscribe(new Consumer<JsonObject>() { | 46 | mRxManager.register(mIModel.getLoginResult(loginName, loginPwd).subscribe(new Consumer<JsonObject>() { |
| 47 | @Override | 47 | @Override |
| 48 | public void accept(JsonObject jsonObject) throws Exception { | 48 | public void accept(JsonObject jsonObject) throws Exception { |
| 49 | - Timber.i("---=== loginResult :%s",jsonObject); | 49 | + Timber.i("---=== loginResult :%s", jsonObject); |
| 50 | try { | 50 | try { |
| 51 | if (jsonObject != null && !TextUtils.isEmpty(jsonObject.get("access_token").getAsString())) { | 51 | if (jsonObject != null && !TextUtils.isEmpty(jsonObject.get("access_token").getAsString())) { |
| 52 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); | 52 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); |
| 53 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName); | 53 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName); |
| 54 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, loginPwd); | 54 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, loginPwd); |
| 55 | - AppConfig.ISLOGIN = true; | ||
| 56 | RetrofitCreateHelper.getInstance().setAuthorization("Bearer " + jsonObject.get("access_token").getAsString()); | 55 | RetrofitCreateHelper.getInstance().setAuthorization("Bearer " + jsonObject.get("access_token").getAsString()); |
| 57 | getUserInfo(loginName, 0, ""); | 56 | getUserInfo(loginName, 0, ""); |
| 58 | } else { | 57 | } else { |
| @@ -168,11 +167,14 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -168,11 +167,14 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
| 168 | mRxManager.register(mIModel.nimLoginResult(account, password).subscribe(new Consumer<NIMLoginResultBean>() { | 167 | mRxManager.register(mIModel.nimLoginResult(account, password).subscribe(new Consumer<NIMLoginResultBean>() { |
| 169 | @Override | 168 | @Override |
| 170 | public void accept(NIMLoginResultBean bean) throws Exception { | 169 | public void accept(NIMLoginResultBean bean) throws Exception { |
| 171 | - if (bean.isSuccess()) | 170 | + if (bean.isSuccess()) { |
| 171 | + AppConfig.ISLOGIN = true; | ||
| 172 | mIView.getUserInfo(0); | 172 | mIView.getUserInfo(0); |
| 173 | + } | ||
| 173 | } | 174 | } |
| 174 | })); | 175 | })); |
| 175 | } | 176 | } |
| 177 | + | ||
| 176 | public void reSetpassResult(final String adminName, String idCode, String password) { | 178 | public void reSetpassResult(final String adminName, String idCode, String password) { |
| 177 | mRxManager.register(mIModel.reSetpass(adminName, idCode, password).subscribe(new Consumer<JsonObject>() { | 179 | mRxManager.register(mIModel.reSetpass(adminName, idCode, password).subscribe(new Consumer<JsonObject>() { |
| 178 | @Override | 180 | @Override |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
| @@ -59,7 +59,7 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -59,7 +59,7 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 59 | 59 | ||
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | - private void setPersonInfo() { | 62 | + private void setPersonInfo() { |
| 63 | if (AppConfig.ISLOGIN) { | 63 | if (AppConfig.ISLOGIN) { |
| 64 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); | 64 | String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); |
| 65 | ToastUtils.showToast(url); | 65 | ToastUtils.showToast(url); |
| @@ -103,7 +103,6 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -103,7 +103,6 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 103 | default: | 103 | default: |
| 104 | break; | 104 | break; |
| 105 | } | 105 | } |
| 106 | - | ||
| 107 | } | 106 | } |
| 108 | 107 | ||
| 109 | @Override | 108 | @Override |
build.gradle
| @@ -5,9 +5,11 @@ buildscript { | @@ -5,9 +5,11 @@ buildscript { | ||
| 5 | repositories { | 5 | repositories { |
| 6 | google() | 6 | google() |
| 7 | jcenter() | 7 | jcenter() |
| 8 | + mavenCentral() // add repository | ||
| 8 | } | 9 | } |
| 9 | dependencies { | 10 | dependencies { |
| 10 | classpath 'com.android.tools.build:gradle:3.0.1' | 11 | classpath 'com.android.tools.build:gradle:3.0.1' |
| 12 | + classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin | ||
| 11 | 13 | ||
| 12 | 14 | ||
| 13 | // NOTE: Do not place your application dependencies here; they belong | 15 | // NOTE: Do not place your application dependencies here; they belong |