QQ或者微薄登录

import com.qq.connect.QQConnectException;
import com.qq.connect.api.OpenID;
import com.qq.connect.api.qzone.UserInfo;
import com.qq.connect.javabeans.AccessToken;
import com.qq.connect.oauth.Oauth;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import weibo4j.Account;
import weibo4j.Users;
import weibo4j.model.WeiboException;
import weibo4j.org.json.JSONException;



@RequestMapping("/oauth/checkqq.jspx")
    public void checkqq(String uid, String from, HttpServletRequest request, HttpServletResponse
            response, org.springframework.ui.Model modelMap) {
        try {
            response.sendRedirect(new Oauth().getAuthorizeURL(request));
        } catch (IOException e) {
            e.printStackTrace();
        } catch (QQConnectException e) {
            e.printStackTrace();
        }
    }

    @RequestMapping("/oauth/checkweibo.jspx")
    public void checkweibo(String uid, String from, HttpServletRequest request, HttpServletResponse
            response, org.springframework.ui.Model modelMap) {
        try {
            response.sendRedirect(new weibo4j.Oauth().authorize("code"));
        } catch (IOException e) {
            e.printStackTrace();
        } catch (WeiboException e) {
            e.printStackTrace();
        }
    }

你可能感兴趣的:(QQ或者微薄登录)