public class Handler1 : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
string fDate = context.Request.Form["fDate"];
string InfoContent=context.Request.Form["InfoContent"];
int InfoKind = Convert.ToInt32(context.Request.Form["InfoKind"]);
string Author = context.Request.Form["Author"];
loginReturn lr = new loginReturn();
int userId = SSO.Class2.ValidateUserInfo(fDate,InfoKind,InfoContent,Author);
if (userId > 0)
{
SSORequest ssorequest = new SSORequest();
if (Authentication.CreateAppToken(ssorequest))
{
lr.userId = userId;
lr.AA_Token = ssorequest.AA_Token;
context.Response.Write(JsonHelper.JsonSerializer(lr));
}
}
lr.userId = -1;
lr.AA_Token = "";
context.Response.Write(JsonHelper.JsonSerializer(lr));
}
.ashx ,ajax 异步的查询 用户信息
当前用户已经登录的话就输出用户信息,不过看了好像代码错了把,,
lr.AA_Token = ssorequest.AA_Token;
context.Response.Write(JsonHelper.JsonSerializer(lr));
后面应该要停止输出 context.Response.End();
不然后面应该后面继续输出,没登陆信息。。
大神能加个QQ说么!麻烦你给小弟分析下!