Merge remote-tracking branch 'origin/develop_new' into develop_new

This commit is contained in:
huangjian
2020-05-11 22:05:41 +08:00
8 changed files with 15 additions and 12 deletions

View File

@@ -694,6 +694,10 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
*/
private void checkBindPhone() {
// BinderPhoneActivity.start(context, true);
if (UserModel.get().getCacheLoginUserInfo().getDefUser() == 4){
return;
}
BindPhoneActivity.start(context);
}

View File

@@ -27,6 +27,7 @@ import com.yizhuan.xchat_android_core.auth.event.LoginEvent;
import com.yizhuan.xchat_android_core.auth.exception.BanAccountException;
import com.yizhuan.xchat_android_core.auth.exception.IsSuperAdminException;
import com.yizhuan.xchat_android_core.auth.exception.ShowPhoneCodeException;
import com.yizhuan.xchat_android_core.code.CodeType;
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
@@ -157,7 +158,7 @@ public class BindCodeActivity extends BaseLoginAct {
return;
}
AuthModel.get()
.sendLoginCode(mPhone,TYPE_SMS)
.sendLoginCode(mPhone, CodeType.REGISTER)
.observeOn(AndroidSchedulers.mainThread())
.compose(bindUntilEvent(ActivityEvent.DESTROY))
.subscribe(new SingleObserver<String>() {
@@ -171,7 +172,7 @@ public class BindCodeActivity extends BaseLoginAct {
tvDesc.setText(getString(R.string.str_send_code_success)+mPhone);
startCountDownTimer();
toast(s);
setResult(RESULT_OK);
}
@Override
@@ -248,6 +249,7 @@ public class BindCodeActivity extends BaseLoginAct {
public void onSuccess(UserInfo s) {
getDialogManager().dismissDialog();
toast("绑定手机号成功");
setResult(RESULT_OK);
finish();
}

View File

@@ -328,7 +328,7 @@ public class LoginActivity extends BaseLoginAct implements View.OnClickListener
});
}else {
AuthModel.get()
.sendLoginCode(accountEt.getEditableText().toString(), deviceId)
.sendLoginCode(accountEt.getEditableText().toString(), 0)
.observeOn(AndroidSchedulers.mainThread())
.compose(bindUntilEvent(ActivityEvent.DESTROY))
.subscribe(new SingleObserver<String>() {

View File

@@ -166,7 +166,7 @@ public class LoginCodeActivity extends BaseLoginAct {
return;
}
AuthModel.get()
.sendLoginCode(mPhone,TYPE_SMS)
.sendLoginCode(mPhone,CodeType.REGISTER)
.observeOn(AndroidSchedulers.mainThread())
.compose(bindUntilEvent(ActivityEvent.DESTROY))
.subscribe(new SingleObserver<String>() {

View File

@@ -16,7 +16,6 @@ import android.widget.ImageView;
import com.yizhuan.erban.R;
import com.yizhuan.erban.base.BaseActivity;
import com.yizhuan.erban.ui.login.helper.LogoutHelper;
import com.yizhuan.xchat_android_core.auth.event.LoginEvent;
import com.yizhuan.xchat_android_library.utils.NetworkUtils;
import com.yizhuan.xchat_android_library.utils.TextWatcherWrapper;
@@ -25,8 +24,6 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import io.reactivex.Single;
/**
* @author zhouxiangfeng
* @date 17/2/26

View File

@@ -1324,8 +1324,8 @@ public class AuthModel extends BaseModel implements IAuthModel {
* @param phone
* @return
*/
public Single<String> sendLoginCode(String phone, String type) {
return api.sendCode(phone, type)
public Single<String> sendLoginCode(String phone, int type) {
return api.sendCode(phone, String.valueOf(type))
.subscribeOn(Schedulers.io())
.map(objectServiceResult -> {
if (!objectServiceResult.isSuccess()) {

View File

@@ -149,7 +149,7 @@ public final class UserModel extends BaseModel implements IUserModel {
return Single.error(new Throwable("need nick and avatar"));
}
//如果没有绑定手机号,提醒去绑定手机号
if (!userInfo.isBindPhone()) {
if (!userInfo.isBindPhone() && userInfo.getDefUser() != 4) {
EventBus.getDefault().post(new NeedBindPhoneEvent());
return Single.error(new Throwable("need bind phone"));
}
@@ -413,7 +413,7 @@ public final class UserModel extends BaseModel implements IUserModel {
})
.doOnSuccess(data -> {
EventBus.getDefault().post(new CurrentUserInfoCompleteEvent());
if (!data.isBindPhone()) {
if (!data.isBindPhone() && data.getDefUser() != 4) {
EventBus.getDefault().post(new NeedBindPhoneEvent());
} else {
//如果是手机号码注册,完善资料后,登录流程结束,发出加载事件

View File

@@ -63,7 +63,7 @@ public class UserInfo implements Serializable {
private long fansNum;
//人气值
private long fortune;
//1普通账号2官方账号3机器账号
//1普通账号2官方账号3机器账号 ,4公会账号
private int defUser;
//地区
private String region;