package com.cnd3b.utility.qywechat.tools;

import com.cnd3b.utility.qywechat.base.GetAccessToken;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

/**
 * 二次验证，关注，暂不用
 * @author Administrator
 *
 */
public class AuthSucc {
	public String result = "";

	public AuthSucc(String USERID) throws IOException {
		URL url = new URL(
				"https://qyapi.weixin.qq.com/cgi-bin/user/authsucc?access_token="
						+ GetAccessToken.get() + "&userid=" + USERID);
		URLConnection connection = url.openConnection();
		// 获取媒体文件上传的输入流（从微信服务器读数据）
		BufferedReader in = new BufferedReader(new InputStreamReader(
				connection.getInputStream()));
		StringBuffer content = new StringBuffer();
		String line = null;
		while ((line = in.readLine()) != null) { 
			content.append(line);
		}
		in.close();
		// 测试打印结果
		result = content.toString();

	}
}
