新路交接口替换

This commit is contained in:
lijia 2024-11-26 11:01:13 +08:00
parent f5e24e2273
commit d8f80ad07d
6 changed files with 12 additions and 10 deletions

View File

@ -55,15 +55,15 @@ class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListe
} }
R.id.tvOk,R.id.tvPhone -> { R.id.tvOk,R.id.tvPhone -> {
dismiss() dismiss()
if (XPermission.create(context).isGranted(Manifest.permission.CALL_PHONE)){ // if (XPermission.create(context).isGranted(Manifest.permission.CALL_PHONE)){
val toString = tvPhone.text.toString() val toString = tvPhone.text.toString()
val intent = Intent(Intent.ACTION_DIAL) val intent = Intent(Intent.ACTION_DIAL)
val data = Uri.parse("tel:$toString") val data = Uri.parse("tel:$toString")
intent.data = data intent.data = data
context.startActivity(intent) context.startActivity(intent)
}else{ // }else{
ToastUtils.showToast(context,"请开启电话权限") // ToastUtils.showToast(context,"请开启电话权限")
} // }
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString()) // BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
} }

View File

@ -37,7 +37,7 @@ public class BaseObserver<T> implements Observer<CommonResponseBean<T>> {
@Override @Override
public void onNext(CommonResponseBean<T> tCommonResponseBean) { public void onNext(CommonResponseBean<T> tCommonResponseBean) {
if (0==tCommonResponseBean.getCode()) { if ("0".equals(tCommonResponseBean.getCode())) {
mRxHttpCallBack.onSuccess(tCommonResponseBean); mRxHttpCallBack.onSuccess(tCommonResponseBean);
} else { } else {
mRxHttpCallBack.onCodeError(mContext, tCommonResponseBean); mRxHttpCallBack.onCodeError(mContext, tCommonResponseBean);

View File

@ -86,7 +86,7 @@ public abstract class RxHttpCallBack<T> {
dialog.dismiss(); dialog.dismiss();
} }
if (t.getCode() == 401) { if (t.getCode() == "401") {
UiAuxiliary.delLogin(mContext); UiAuxiliary.delLogin(mContext);
Intent intent = new Intent(mContext, MainActivity.class); Intent intent = new Intent(mContext, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);

View File

@ -32,6 +32,7 @@ import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager; import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack; import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity; import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
import com.dahe.mylibrary.net.CommonResponseBean; import com.dahe.mylibrary.net.CommonResponseBean;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.arpa.hndahesudintocctmsdriver.R; import com.arpa.hndahesudintocctmsdriver.R;
@ -100,6 +101,8 @@ public class LoginActivity extends BaseActivity {
Log.e("--登录信息--", new Gson().toJson(loginBean)); Log.e("--登录信息--", new Gson().toJson(loginBean));
AppInfoBean appInfoBean = new AppInfoBean(); AppInfoBean appInfoBean = new AppInfoBean();
if (loginBean.getCode() == 200) { if (loginBean.getCode() == 200) {
//获取新路交token
NewLJUtils.getInstance().getToken(con);
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken()); SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname()); SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname()); SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());

View File

@ -236,7 +236,6 @@ public class MyFragment extends BaseFragment {
}); });
//联系我们 //联系我们
onContact.setOnClickListener(v -> { onContact.setOnClickListener(v -> {
NewLJUtils.getInstance().getToken(con);
String serviceMobile = ""; String serviceMobile = "";
if (ConfigParts.getConfigParts(con) != null) { if (ConfigParts.getConfigParts(con) != null) {
serviceMobile = ConfigParts.getConfigParts(con).getData().getServiceMobile(); serviceMobile = ConfigParts.getConfigParts(con).getData().getServiceMobile();

View File

@ -8,7 +8,7 @@ import java.io.Serializable;
public class CommonResponseBean<T> implements Serializable { public class CommonResponseBean<T> implements Serializable {
private T data; private T data;
private int code; private String code;
private String info; private String info;
private String msg; private String msg;
private String message; private String message;
@ -59,11 +59,11 @@ public class CommonResponseBean<T> implements Serializable {
this.data = data; this.data = data;
} }
public int getCode() { public String getCode() {
return code; return code;
} }
public void setCode(int code) { public void setCode(String code) {
this.code = code; this.code = code;
} }