Commit 93fc9124 authored by jianglx's avatar jianglx

修改缓存保存的文件;在登录页面添加code的上传

parent a6483d05
...@@ -5,13 +5,13 @@ import android.content.SharedPreferences; ...@@ -5,13 +5,13 @@ import android.content.SharedPreferences;
public class Cooker { public class Cooker {
private final static String COOK_FILE = "cooker"; private final static String COOKIE_FILE = "cookie" ;
private static SharedPreferences preferences; private static SharedPreferences preferences;
private static SharedPreferences getPreference(Context context) { private static SharedPreferences getPreference(Context context) {
if (preferences == null) { if (preferences == null) {
preferences = context.getSharedPreferences(COOK_FILE, Context.MODE_PRIVATE); preferences = context.getSharedPreferences(COOKIE_FILE, Context.MODE_PRIVATE);
} }
return preferences; return preferences;
} }
...@@ -67,7 +67,6 @@ public class Cooker { ...@@ -67,7 +67,6 @@ public class Cooker {
public static float getFloatValue(Context context, String key, float def) { public static float getFloatValue(Context context, String key, float def) {
return getPreference(context).getFloat(key, def); return getPreference(context).getFloat(key, def);
} }
public static boolean getBooleanValue(Context context, String key) { public static boolean getBooleanValue(Context context, String key) {
return getBooleanValue(context, key, false); return getBooleanValue(context, key, false);
} }
......
...@@ -20,6 +20,8 @@ import com.ruiwenliu.wrapper.util.RxJavaManager; ...@@ -20,6 +20,8 @@ import com.ruiwenliu.wrapper.util.RxJavaManager;
import com.ruiwenliu.wrapper.util.listener.TextChangedListener; import com.ruiwenliu.wrapper.util.listener.TextChangedListener;
import com.ruiwenliu.wrapper.weight.TitleView; import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.CacheEnum;
import com.rv.component.utils.Cooker;
import com.rv.home.R; import com.rv.home.R;
import com.rv.home.R2; import com.rv.home.R2;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
...@@ -115,7 +117,7 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> { ...@@ -115,7 +117,7 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> {
processLoginData((RegisteredBean) result); processLoginData((RegisteredBean) result);
break; break;
case 10: case 10:
setDataUser((BeanUserInfo)result); setDataUser((BeanUserInfo) result);
break; break;
} }
} }
...@@ -201,14 +203,12 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> { ...@@ -201,14 +203,12 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> {
map.put("username", getPhone()); map.put("username", getPhone());
map.put("mobilecode", getCode()); map.put("mobilecode", getCode());
map.put("type", 2); map.put("type", 2);
map.put("code", Cooker.getStringValue(getApplicationContext(), "code"));
mPresenter.postData(2, ApiConfig.HTTP_URL_PWD_LOGIN, RegisteredBean.class, map, true); mPresenter.postData(2, ApiConfig.HTTP_URL_PWD_LOGIN, RegisteredBean.class, map, true);
} }
/** /**
*
*
*
* 获得手机号 * 获得手机号
* *
* @return * @return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment