wjc
2023-06-12 390261037c530be2a59e99a93ed44f6817d0d006
app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java
@@ -17,12 +17,17 @@
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) {
@@ -48,14 +53,12 @@
        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());
                    }
                }
            }
@@ -88,15 +91,13 @@
        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());
                    }
                }
            }