protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //int uid = Convert.ToInt32(Request.QueryString["state"]); M_UserInfo mu = buser.GetLogin();//注意域名不要子域名跳过来 M_User_Token tokenMod = tokenbll.SelModelByUid(mu.UserID); if (tokenMod == null) { tokenMod = new M_User_Token(); } switch (Request.QueryString["s"]) { case "qq": //使用JS SDK break; default: //Sina string code = Request.QueryString["code"]; if (!string.IsNullOrEmpty(code)) { M_Third_Info appmod = thirdBll.SelModelByName("Sina"); SinaHelper sinaBll = new SinaHelper(null); tokenMod.uid = mu.UserID; tokenMod.SinaToken = sinaBll.GetTokenByCode(code); tokenbll.InsertORUpdate(tokenMod); } Response.Redirect("/Plat/UpCenter.aspx?Set=1"); break; } } }