/** 初始化用户登录信息 */ public void initLoginInfo() { User loginUser = getLoginInfo(); if (loginUser != null && loginUser.getUid() > 0 && loginUser.isRememberMe()) { this.loginUid = loginUser.getUid(); this.login = true; } else { this.Logout(); } }
/** * 保存登录信息 * * @param username * @param pwd */ public void saveLoginInfo(final User user) { this.loginUid = user.getUid(); this.login = true; setProperties( new Properties() { { setProperty("user.uid", String.valueOf(user.getUid())); setProperty("user.name", user.getName()); setProperty("user.face", FileUtils.getFileName(user.getFace())); // 用户头像-文件名 setProperty("user.account", user.getAccount()); setProperty("user.pwd", CyptoUtils.encode("oschinaApp", user.getPwd())); setProperty("user.location", user.getLocation()); setProperty("user.followers", String.valueOf(user.getFollowers())); setProperty("user.fans", String.valueOf(user.getFans())); setProperty("user.score", String.valueOf(user.getScore())); setProperty("user.isRememberMe", String.valueOf(user.isRememberMe())); // 是否记住我的信息 } }); }
public void onClick(View v) { if (mUser == null) return; UIHelper.showTweetPub(UserCenter.this, "@" + mUser.getName() + " ", mUser.getUid()); }
public void onClick(View v) { if (mUser == null) return; UIHelper.showMessagePub(UserCenter.this, mUser.getUid(), mUser.getName()); }