@Override
	public void storeToken(String code, String userId) 
			throws WeiboException, KankantuException {
		Oauth oauth = new Oauth();
		// weibo userid和token
		AccessToken token = oauth.getAccessTokenByCode(code);
		if (null == token) {
			return;
		}
		
		// 获取用户微博的信息
		String uid = token.getUid();
		Users users = new Users();
		users.setToken(token.getAccessToken());
		User user = users.showUserById(uid);
		// 保存授权信息
		SinaWeiboAuthorizeInfo info = new SinaWeiboAuthorizeInfo(uid, user.getScreenName(), token.getAccessToken(), TimeUtils.getCurTime());
		if (sinaWeiboAuthorizeDao.insert(info, userId) <= 0) {
			throw new KankantuException("保存授权信息失败");
		}
		// 保存token到最新的token
		Token t = new Token(userId, uid, user.getScreenName(), token.getAccessToken(), "0");
		try {
			sinaWeiboTokenDao.insert(t);
		} catch (KankantuException e) {
			throw new KankantuException("保存token信息失败");
		}
	}