public static bool 添加微信用户(微信用户 content) { return Mongo.添加(content); }
public static bool 更新微信用户(微信用户 content) { return Mongo.更新(content); }
public ActionResult CheckSuccess() { var openid = Request.Params["openid"]; var userid = Session["weChatUserId"].ToString(); if (string.IsNullOrWhiteSpace(openid) || string.IsNullOrWhiteSpace(userid)) { return Content("绑定时出现错误,错误代码0x2546"); } if (微信管理.计数微信用户(0, 0, Query<微信用户>.EQ(o => o.openId, openid)) > 0) { return Content("该账号已经绑定过,无需重复绑定!如有疑问,请联系客服!"); } try { 微信用户 wu = new 微信用户(); wu.验证时间 = DateTime.Now; wu.已验证 = true; wu.用户链接.用户ID = long.Parse(userid); wu.openId = openid; 微信管理.添加微信用户(wu); return Content("1"); } catch { return Content("绑定时出现错误,错误代码0x6548"); } }