39 lines
961 B
Java
39 lines
961 B
Java
package com.arpa.hndahesudintocctmsdriver.parts;
|
|
|
|
import android.content.Context;
|
|
import android.util.Log;
|
|
|
|
import com.google.gson.Gson;
|
|
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
|
|
|
/**
|
|
* @author hlh
|
|
* @version 1.0.0
|
|
* @date 2021/9/9 15:39
|
|
* @description:
|
|
*/
|
|
public class AuthParts {
|
|
|
|
private static Gson gson=new Gson();
|
|
|
|
public static DriverAuthDataBean getAuth(Context con){
|
|
String authData=SPUtil.getSP(con,"data","authdata");
|
|
Log.e("--data--",authData);
|
|
if("".equals(authData)){
|
|
return null;
|
|
}else {
|
|
return gson.fromJson(authData, DriverAuthDataBean.class);
|
|
}
|
|
}
|
|
|
|
public static void setAuth(Context con,DriverAuthDataBean auth){
|
|
if(auth!=null){
|
|
//组件修改
|
|
|
|
//数据修改
|
|
SPUtil.insSP(con,"data","authdata",gson.toJson(auth));
|
|
}
|
|
}
|
|
}
|