|
|
@@ -64,7 +64,6 @@ public class MsgVerifyModel extends BaseModel implements MsgVerifyContacts.IMsgV
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 登录
|
|
|
*
|
|
|
@@ -73,12 +72,12 @@ public class MsgVerifyModel extends BaseModel implements MsgVerifyContacts.IMsgV
|
|
|
* @param mvpDataCallBack
|
|
|
*/
|
|
|
@Override
|
|
|
- public void httpLogin( String code, String clientId, final MvpDataCallBack<Boolean> mvpDataCallBack) {
|
|
|
+ public void httpLogin(String code, String clientId, final MvpDataCallBack<Boolean> mvpDataCallBack) {
|
|
|
RetrofitHttpParams params = new RetrofitHttpParams(mContext);
|
|
|
params.put("phone", getPhoneNum());
|
|
|
params.put("code", code);
|
|
|
params.put("client_id", clientId);
|
|
|
- new LoginSubscribe(mContext).requestLoginNew(params.getRequestParams(), new ApiObserver<ApiLoginBean>(mContext, true,false) {
|
|
|
+ new LoginSubscribe(mContext).requestLoginNew(params.getRequestParams(), new ApiObserver<ApiLoginBean>(mContext, true, false) {
|
|
|
@Override
|
|
|
public void onSuccess(ApiLoginBean data) {
|
|
|
if (data != null) {
|
|
|
@@ -104,8 +103,10 @@ public class MsgVerifyModel extends BaseModel implements MsgVerifyContacts.IMsgV
|
|
|
@Override
|
|
|
public void onError(ApiLoginBean data, ApiException exception) {
|
|
|
super.onError(data, exception);
|
|
|
- if (data != null && exception != null) {
|
|
|
- mApiLoginBean = data;
|
|
|
+ if (exception != null) {
|
|
|
+ if (data != null) {
|
|
|
+ mApiLoginBean = data;
|
|
|
+ }
|
|
|
mvpDataCallBack.onError(exception);
|
|
|
}
|
|
|
}
|
|
|
@@ -164,7 +165,7 @@ public class MsgVerifyModel extends BaseModel implements MsgVerifyContacts.IMsgV
|
|
|
*/
|
|
|
@Override
|
|
|
public String getPhoneNum() {
|
|
|
- if(TextUtils.isEmpty(phoneNum)) {
|
|
|
+ if (TextUtils.isEmpty(phoneNum)) {
|
|
|
if (getType() == AppConstant.MSG_VERIFY_LOGIN) {//如果是登录界面过来的则使用传递的电话号码
|
|
|
phoneNum = ((MsgVerifyActivity) mContext).getIntent().getStringExtra(IntentConstant.CONTENT);
|
|
|
} else if (AppCacheManager.getInstance().getMemberModel() != null && !TextUtils.isEmpty(AppCacheManager.getInstance().getMemberModel().getPhone())) {
|