Example #1
0
        public static string ShopUrl(string url)
        {
            B_User  bu        = new B_User();
            B_Admin ba        = new B_Admin();
            string  resultUrl = "";

            if (url == null || url.Trim() == "")
            {
                //function.Alert("禁止非法进入!");
                //return;
            }
            Security objSecurity = new Security();
            string   urlEncrypt  = objSecurity.EncryptQueryString(url.ToString());
            string   userUrl     = "";

            if (ba.CheckLogin())
            {
                userUrl = objSecurity.EncryptQueryString(bu.GetLogin().UserID.ToString() + "_admin");
            }
            else if (bu.CheckLogin())
            {
                userUrl = objSecurity.EncryptQueryString(bu.GetLogin().UserID.ToString() + "_member");
            }
            else
            {
                userUrl = objSecurity.EncryptQueryString("-1_visitor");
            }
            resultUrl = "http://" + System.Web.HttpContext.Current.Request.Url.Authority + "/api/ShopSource.aspx?sus=" + userUrl + "&sur=" + urlEncrypt;

            return(resultUrl);
        }
Example #2
0
 /// <summary>
 /// 如处理微信浏览器,但未登录,则自动注册或登录(按公众号)
 /// </summary>
 public static void AutoSync(string url, M_WX_APPID appMod = null)
 {
     if (DeviceHelper.GetBrower() == DeviceHelper.Brower.Micro)
     {
         B_User buser = new B_User();
         if (!buser.CheckLogin())
         {
             WxAPI  wxapi        = WxAPI.Code_Get();
             string redirect_uri = SiteConfig.SiteInfo.SiteUrl + "/user/wxuser.aspx";
             string api          = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + wxapi.AppId.APPID + "&redirect_uri=" + redirect_uri + "&response_type=code&scope=snsapi_userinfo&state=" + url + "#wechat_redirect";
             HttpContext.Current.Response.Redirect(api);
         }
     }
 }