| | |
| | | /** |
| | | * 保存微信登陆Token |
| | | */ |
| | | public AccessTokenBean getWXToken() { |
| | | SharedPreferences preferences = mContext.getSharedPreferences(SP_LOGIN_USER_KEY, Context.MODE_PRIVATE); |
| | | String s = preferences.getString("token_wx", null); |
| | | if (s == null) { |
| | | return null; |
| | | } else |
| | | return GsonUtil.toObj(s, AccessTokenBean.class); |
| | | } |
| | | |
| | | /** |
| | | * 保存微信登陆Token |
| | | */ |
| | | public void removeWXToken() { |
| | | SharedPreferences preferences = mContext.getSharedPreferences(SP_LOGIN_USER_KEY, Context.MODE_PRIVATE); |
| | | Editor edit = preferences.edit(); |
| | |
| | | editor.putInt("is_open_upload", loginUser.getIs_open_upload()); |
| | | editor.putInt("is_lock", loginUser.getIs_lock()); |
| | | editor.putInt("video", loginUser.getVideo()); |
| | | editor.putInt("login_type", loginUser.getLogin_type()); |
| | | editor.commit(); |
| | | } |
| | | |
| | |
| | | loginUserInfo.setIs_open_upload(sp.getInt("is_open_upload", 1)); |
| | | loginUserInfo.setIs_lock(sp.getInt("is_lock", 0)); |
| | | loginUserInfo.setVideo(sp.getInt("video", 0)); |
| | | loginUserInfo.setLogin_type(sp.getInt("login_type", -1)); |
| | | return loginUserInfo; |
| | | } |
| | | |
| | |
| | | editor.putInt("is_open_upload", 0); |
| | | editor.putInt("is_lock", 0); |
| | | editor.putInt("video", 0); |
| | | editor.putInt("login_type", -1); |
| | | editor.commit(); |
| | | MainApp.theApp.userId = ""; |
| | | saveShowAd(""); |
| | | } |
| | | |
| | | /** |
| | | * 保存是否第一次登陆 |
| | | * |
| | | * @param flag |
| | | */ |
| | | public void saveFirstUse(int flag) { |
| | | SharedPreferences preferences = mContext.getSharedPreferences("firstInfo", |
| | | Context.MODE_PRIVATE); |
| | | Editor editor = preferences.edit(); |
| | | editor.putInt("firstUse", flag); |
| | | editor.commit(); |
| | | } |
| | | |
| | | public int getFirstUse() { |
| | | SharedPreferences preferences = mContext.getSharedPreferences("firstInfo", |
| | | Context.MODE_PRIVATE); |
| | | int firstUse = preferences.getInt("firstUse", 0); |
| | | return firstUse; |
| | | } |
| | | |
| | | |
| | | public void saveShowAd(String time) { |
| | | SharedPreferences preferences = mContext.getSharedPreferences("firstInfo", |