river-lucky-driver/app/src/main/java/com/arpa/hndahesudintocctmsdriver/ui/UiAuxiliary.java
2022-08-24 09:32:54 +08:00

54 lines
1.6 KiB
Java

package com.arpa.hndahesudintocctmsdriver.ui;
import android.content.Context;
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
import org.greenrobot.eventbus.EventBus;
import cn.jpush.android.api.JPushInterface;
/**
* @author hlh
* @version 1.0.0
* @date 2021/8/18 8:45
* @description:ui界面的辅助类
*/
public class UiAuxiliary {
public static String getState(int stateCode){
String state="";
switch (stateCode){
case 100001: state="待认证";break;
case 100002: state="审核中";break;
case 100003: state="审核通过";break;
case 100004: state="审核不通过";break;
default:state="未认证";break;
}
return state;
}
public static boolean isLogin(Context con){
if (SPUtil.getSP(con, LoginActivity.USER,LoginActivity.USER_TOKEN).equals("")){
return false;
}
return true;
}
public static void delLogin(Context con){
JPushInterface.deleteAlias(con,0);
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_RNAME,"");
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_ID,"");
SPUtil.insSP(con,"user","userdata","");
}
public static void homeRequest(String msg){
HomeEvent he=new HomeEvent(msg);
EventBus.getDefault().post(he);
}
}