| | |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * 登陆界面的逻辑 |
| | | * 登录界面的逻辑 |
| | | */ |
| | | public class HdlAccountLogic { |
| | | |
| | | private static volatile HdlAccountLogic sHdlAccountLogic; |
| | | |
| | | /** |
| | | * 获取当前对象 |
| | | * |
| | | * @return HdlAccountLogic |
| | | */ |
| | | public static synchronized HdlAccountLogic getInstance() { |
| | | if (sHdlAccountLogic == null) { |
| | | synchronized (HdlAccountLogic.class) { |
| | |
| | | HttpClient.getInstance().requestFullHttp(full, jsonObject.toString(), true, true, new BaseSuccessFailureCallBeak() { |
| | | @Override |
| | | public void onSuccess(HttpResponsePack httpResponsePack) { |
| | | if (httpResponsePack.getData() != null) { |
| | | if (httpResponsePack != null && httpResponsePack.getData() != null) { |
| | | Gson gson = new Gson(); |
| | | String json = gson.toJson(httpResponsePack.getData()); |
| | | LoginUserRegionBean loginUserRegionBean = new Gson().fromJson(json, LoginUserRegionBean.class); |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(loginUserRegionBean); |
| | | } else { |
| | | cloudCallBeak.onFailure(new Exception()); |
| | | } |
| | | } |
| | | } |
| | |
| | | HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() { |
| | | @Override |
| | | public void onSuccess(HttpResponsePack httpResponsePack) { |
| | | if (httpResponsePack.getData() != null) { |
| | | if (httpResponsePack != null && httpResponsePack.getData() != null) { |
| | | Gson gson = new Gson(); |
| | | String json = gson.toJson(httpResponsePack.getData()); |
| | | LoginBean loginBean = new Gson().fromJson(json, LoginBean.class); |
| | | saveUserData(loginBean); |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(loginBean); |
| | | } else { |
| | | cloudCallBeak.onFailure(new Exception()); |
| | | } |
| | | } |
| | | } |