1:修改交友房

2:修改拍卖房
3:修改飘屏(没有修改成功)
This commit is contained in:
2025-09-24 00:30:40 +08:00
parent 1c54f0c072
commit 5f573e607d
43 changed files with 1172 additions and 307 deletions

View File

@@ -287,7 +287,30 @@ public class RetrofitClient {
}
public void login(String mobile, String password, BaseObserver<List<UserBean>> observer) {
sApiServer.login(mobile, password).compose(new DefaultTransformer<>()).subscribe(observer);
sApiServer.login(mobile, password).enqueue(new Callback<BaseModel<List<UserBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<UserBean>>> call, Response<BaseModel<List<UserBean>>> response) {
if (response.code() == 200){
BaseModel<List<UserBean>> listBaseModel=response.body();
if (listBaseModel!=null){
int code=listBaseModel.getCode();
if (code==1){
observer.onNext(listBaseModel.getData());
}else if (code==301){
ToastUtils.showShort(listBaseModel.getMsg());
}else {
ToastUtils.showShort(listBaseModel.getMsg());
}
}
}
}
@Override
public void onFailure(Call<BaseModel<List<UserBean>>> call, Throwable t) {
t.printStackTrace();
}
});
}
public void userLogin(String mobile, String password, BaseObserver<List<UserBean>> observer) {
@@ -316,14 +339,18 @@ public class RetrofitClient {
if (code == 1) {
observer.onNext(string.getData());
} else if (code == 301) {
try {
ToastUtils.showShort("提示当前账号已在别的地方登陆,如果不是本人操作请修改密码");
CommonAppContext.getInstance().clearLoginInfo();
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
// try {
ToastUtils.showShort(string.getMsg());
// ToastUtils.showShort("提示当前账号已在别的地方登陆,如果不是本人操作请修改密码");
// CommonAppContext.getInstance().clearLoginInfo();
// } catch (ClassNotFoundException e) {
// throw new RuntimeException(e);
// }
}else {
ToastUtils.showShort(string.getMsg());
}
}
}
}
@@ -833,7 +860,12 @@ public class RetrofitClient {
public void onResponse(Call<BaseModel<List<UserBean>>> call, Response<BaseModel<List<UserBean>>> response) {
if (response.code() == 200) {
BaseModel<List<UserBean>> baseModel = response.body();
observer.onNext(baseModel.getData());
if (baseModel.getCode()==1) {
observer.onNext(baseModel.getData());
}else if (baseModel.getCode()==301){
ToastUtils.showShort(baseModel.getMsg());
observer.onNext(null);
}
}
}
@@ -2048,14 +2080,16 @@ public class RetrofitClient {
@Override
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
ToastUtils.showShort("提示当前账号已在别的地方登陆,如果不是本人操作请修改密码");
// ToastUtils.showShort("提示当前账号已在别的地方登陆,如果不是本人操作请修改密码");
if (t.toString().contains("登录失效")) {
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(t.toString());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
ToastUtils.showShort(t.toString());
}
});
}