浏览代码

优化注销页面退出逻辑

hy 3 年之前
父节点
当前提交
203297a0a2

+ 3 - 2
app/src/main/java/com/electric/chargingpile/activity/LogOutActivity.java

93
                .setCancelable(true)
93
                .setCancelable(true)
94
                .setContent(str)
94
                .setContent(str)
95
                .show();
95
                .show();
96
97
    }
96
    }
98
97
99
98
115
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
114
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
116
                if (rtnCode.equals("01")){
115
                if (rtnCode.equals("01")){
117
                    signOut();
116
                    signOut();
117
                    startActivity(new Intent(LogOutActivity.this,MainMapActivity.class));
118
                }else{
118
                }else{
119
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
119
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
120
                    showDialog(rtnMsg);
120
                    showDialog(rtnMsg);
136
        SharedPreferences sharedPreferences = getSharedPreferences("userInfo",
136
        SharedPreferences sharedPreferences = getSharedPreferences("userInfo",
137
                Activity.MODE_PRIVATE);
137
                Activity.MODE_PRIVATE);
138
        sharedPreferences.edit().clear();
138
        sharedPreferences.edit().clear();
139
        startActivity(new Intent(LogOutActivity.this,MainMapActivity.class));
139
140
    }
140
    }
141
141
142
    /**
142
    /**
268
        if (keyCode == KeyEvent.KEYCODE_BACK){
268
        if (keyCode == KeyEvent.KEYCODE_BACK){
269
            if (state !=null && state.equals("1")){
269
            if (state !=null && state.equals("1")){
270
                signOut();
270
                signOut();
271
                startActivity(new Intent(LogOutActivity.this,MainMapActivity.class));
271
                return true;
272
                return true;
272
            }
273
            }
273
        }
274
        }

+ 2 - 2
app/src/main/java/com/electric/chargingpile/application/MainApplication.java

96
//    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
96
//    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
97
//    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
97
//    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
98

98

99
//        public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
100
    public static String urlNew = "https://api.touchev.com:83/api/0300";// 一电正式环境
99
        public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
100
//    public static String urlNew = "https://api.touchev.com:83/api/0300";// 一电正式环境
101

101

102

102

103
    //	public static String url = "https://cdz.d1ev.com";
103
    //	public static String url = "https://cdz.d1ev.com";