using Bwp.MainSystem;
|
|
using BWP.B3WeChat.Utils;
|
|
using Forks.EnterpriseServices.BusinessInterfaces;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Web;
|
|
using TSingSoft.WebPluginFramework;
|
|
|
|
namespace BWP.Web.Pages
|
|
{
|
|
class WeiChatLogin:IHttpHandler
|
|
{
|
|
public bool IsReusable
|
|
{
|
|
get { return true; }
|
|
}
|
|
|
|
public void ProcessRequest(HttpContext context)
|
|
{
|
|
var code = context.Request.QueryString["code"];
|
|
var openID = WeChatPageUtil.QueryOpenID(code);
|
|
|
|
var userBL = BIFactory.Create<IUserBL>();
|
|
var user = userBL.Get(openID);
|
|
if (user == null)
|
|
{
|
|
throw new Exception("当前微信公众号用户还没有在系统中注册");
|
|
}
|
|
|
|
var url = context.Request.QueryString["url"];
|
|
|
|
context.Response.Redirect(url);
|
|
|
|
}
|
|
}
|
|
}
|