示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("appconfig_edit", "APP设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            val                  = B_BaseConfig.Get("app_menu");
            app_name             = B_BaseConfig.Get("app_name");
            app_lefticon         = B_BaseConfig.Get("app_lefticon");
            app_lefturl          = B_BaseConfig.Get("app_lefturl");
            app_righticon        = B_BaseConfig.Get("app_righticon");
            app_righturl         = B_BaseConfig.Get("app_righturl");
            app_toplogo          = B_BaseConfig.Get("app_toplogo");
            app_toplogourl       = B_BaseConfig.Get("app_toplogourl");
            app_topbackground    = B_BaseConfig.Get("app_topbackground");
            app_topcolor         = B_BaseConfig.Get("app_topcolor");
            app_topline          = B_BaseConfig.Get("app_topline");
            app_bottombackground = B_BaseConfig.Get("app_bottombackground");
            app_bottomcolor      = B_BaseConfig.Get("app_bottomcolor");
            app_bottomline       = B_BaseConfig.Get("app_bottomline");
            app_startimage       = B_BaseConfig.Get("app_startimage");
            app_starturl         = B_BaseConfig.Get("app_starturl");
            app_waittimes        = B_BaseConfig.Get("app_waittimes");
        }
示例#2
0
        /// <summary>
        /// 获取App菜单
        /// </summary>
        public void AppMenus()
        {
            string lang = RequestTool.RequestSafeString("lang", "CN");
            string val  = B_BaseConfig.Get("app_menu");

            val = Language.Content(val, lang);
            JavaScriptSerializer     jss   = new JavaScriptSerializer();
            List <BaseConfigAppMenu> menus = B_BaseConfig.AppMenu(val);

            if (menus != null)
            {
                for (int i = 0; i < menus.Count; i++)
                {
                    menus[i].Icon = "http://" + RequestTool.GetRequestDomain() + menus[i].Icon;
                }
            }
            val = jss.Serialize(menus);
            LBAPI api = new LBAPI();

            api.data = val;
            api.msg  = "OK";
            string json = jss.Serialize(api);

            Response.Write(json);
        }
示例#3
0
        /// <summary>
        /// 已经手动更新时调用
        /// </summary>
        public void Version_UpdateOK()
        {
            if (!EX_Admin.Power("version", "版本管理"))
            {
                AjaxNoPower();
                return;
            }
            int          id    = RequestTool.RequestInt("id");
            Lebi_Version model = B_Lebi_Version.GetModel(id);

            if (model == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            //更新版本号
            BaseConfig cf = new BaseConfig();

            cf.Version_Son = model.Version_Son.ToString();
            cf.Version     = model.Version.ToString();
            B_BaseConfig bcf = new B_BaseConfig();

            bcf.SaveConfig(cf);
            model.IsUpdate    = 1;
            model.Time_Update = System.DateTime.Now;
            B_Lebi_Version.Update(model);
            //同步版本号
            Shop.LebiAPI.Service.Instanse.UpdateVersionCode();
            Response.Write("{\"msg\":\"OK\"}");
        }
示例#4
0
文件: Config.cs 项目: zwkjgs/LebiShop
        public WxPayConfig(Lebi_Order order)
        {
            string where = "";
            if (order != null)
            {
                where = "id = " + order.OnlinePay_id + "";
            }
            else
            {
                where = "Code='weixinpayh5'";
            }
            Lebi_OnlinePay onlinepay = B_Lebi_OnlinePay.GetModel(where);

            if (onlinepay == null)
            {
                Log.Add("在线支付接口 weixinpay 配置错误");
                return;
            }
            Shop.Bussiness.Site site    = new Shop.Bussiness.Site();
            B_BaseConfig        bconfig = new B_BaseConfig();
            BaseConfig          SYS     = bconfig.LoadConfig();

            MCHID = onlinepay.UserName;
            KEY   = onlinepay.UserKey;
            APPID = onlinepay.Appid;
            //SystemLog.Add("weixinpay-WxPayConfig" + "MCHID : " + MCHID + ",KEY : " + KEY + ",APPID : " + APPID);
            //APPSECRET = onlinepay.Appkey;
            //IP = HttpContext.Current.Request.ServerVariables.Get("Local_Addr");
            NOTIFY_URL = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/onlinepay/weixinpayh5/payNotifyUrl.aspx";
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("appconfig_edit", "APP设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            val                       = B_BaseConfig.Get("app_menu");
            app_name                  = B_BaseConfig.Get("app_name");
            app_lefticon              = B_BaseConfig.Get("app_lefticon");
            app_lefturl               = B_BaseConfig.Get("app_lefturl");
            app_righticon             = B_BaseConfig.Get("app_righticon");
            app_righturl              = B_BaseConfig.Get("app_righturl");
            app_toplogo               = B_BaseConfig.Get("app_toplogo");
            app_toplogourl            = B_BaseConfig.Get("app_toplogourl");
            app_topbackground         = B_BaseConfig.Get("app_topbackground");
            app_topcolor              = B_BaseConfig.Get("app_topcolor");
            app_topline               = B_BaseConfig.Get("app_topline");
            app_bottombackground      = B_BaseConfig.Get("app_bottombackground");
            app_bottomcolor           = B_BaseConfig.Get("app_bottomcolor");
            app_bottomline            = B_BaseConfig.Get("app_bottomline");
            app_bottomcount           = B_BaseConfig.Get("app_bottomcount");
            app_startimage            = B_BaseConfig.Get("app_startimage");
            app_starturl              = B_BaseConfig.Get("app_starturl");
            app_waittimes             = B_BaseConfig.Get("app_waittimes");
            app_version               = B_BaseConfig.Get("app_version");
            app_downloadurl           = B_BaseConfig.Get("app_downloadurl");
            app_share                 = B_BaseConfig.Get("app_share");
            app_share_wechat_key      = B_BaseConfig.Get("app_share_wechat_key");
            app_share_wechat_secret   = B_BaseConfig.Get("app_share_wechat_secret");
            app_share_qq_key          = B_BaseConfig.Get("app_share_qq_key");
            app_share_qq_secret       = B_BaseConfig.Get("app_share_qq_secret");
            app_share_dingtalk_key    = B_BaseConfig.Get("app_share_dingtalk_key");
            app_share_dingtalk_secret = B_BaseConfig.Get("app_share_dingtalk_secret");
        }
示例#6
0
        public void AgentConfig_Set()
        {
            if (!EX_Admin.Power("agent_config", "代理-参数设置"))
            {
                AjaxNoPower();
                return;
            }
            B_BaseConfig dob   = new B_BaseConfig();
            BaseConfig   model = new BaseConfig();

            model.Angent_Commission         = RequestTool.RequestString("Angent_Commission");
            model.Angent_Commission_require = RequestTool.RequestString("Angent_Commission_require");
            model.Angent1_Commission        = RequestTool.RequestString("Angent1_Commission");
            model.Angent2_Commission        = RequestTool.RequestString("Angent2_Commission");
            model.Angent3_Commission        = RequestTool.RequestString("Angent3_Commission");
            model.IsUsedAgent         = RequestTool.RequestString("IsUsedAgent");
            model.IsUsedAgent_Area    = RequestTool.RequestString("IsUsedAgent_Area");
            model.IsUsedAgent_Product = RequestTool.RequestString("IsUsedAgent_Product");
            model.CommissionMoneyDays = RequestTool.RequestString("CommissionMoneyDays");
            model.AgentEndDays        = RequestTool.RequestString("AgentEndDays");
            dob.SaveConfig(model);

            Log.Add("代理-参数设置", "Config", "", CurrentAdmin, "");
            Response.Write("{\"msg\":\"OK\"}");
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("smsconfig_edit", "手机短信设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model        = ShopCache.GetBaseConfig();
            SMS_password = model.SMS_password;
            try
            {
                if (model.SMS_server == "0" && model.SMS_state == "1")
                {
                    smsClient = new SMSClient("sms.todaynic.com", Convert.ToInt32(model.SMS_serverport), model.SMS_user, model.SMS_password);
                    account   = smsClient.getBalance();
                }
            }
            catch
            {
            }
            if (SMS_password != "")
            {
                SMS_password = "******";
            }
        }
示例#8
0
        /// <summary>
        /// 获取App配置
        /// </summary>
        public void AppConfig()
        {
            string lang                 = RequestTool.RequestSafeString("lang", "CN");
            string app_name             = Language.Content(B_BaseConfig.Get("app_name"), lang);
            string app_lefticon         = "http://" + RequestTool.GetRequestDomain() + Language.Content(B_BaseConfig.Get("app_lefticon"), lang);
            string app_lefturl          = Language.Content(B_BaseConfig.Get("app_lefturl"), lang);
            string app_righticon        = "http://" + RequestTool.GetRequestDomain() + Language.Content(B_BaseConfig.Get("app_righticon"), lang);
            string app_righturl         = Language.Content(B_BaseConfig.Get("app_righturl"), lang);
            string app_toplogo          = "http://" + RequestTool.GetRequestDomain() + Language.Content(B_BaseConfig.Get("app_toplogo"), lang);
            string app_toplogourl       = Language.Content(B_BaseConfig.Get("app_toplogourl"), lang);
            string app_topbackground    = Language.Content(B_BaseConfig.Get("app_topbackground"), lang);
            string app_topcolor         = Language.Content(B_BaseConfig.Get("app_topcolor"), lang);
            string app_topline          = Language.Content(B_BaseConfig.Get("app_topline"), lang);
            string app_bottombackground = Language.Content(B_BaseConfig.Get("app_bottombackground"), lang);
            string app_bottomcolor      = Language.Content(B_BaseConfig.Get("app_bottomcolor"), lang);
            string app_bottomline       = Language.Content(B_BaseConfig.Get("app_bottomline"), lang);
            string app_startimage       = Language.Content(B_BaseConfig.Get("app_startimage"), lang);
            string app_starturl         = Language.Content(B_BaseConfig.Get("app_starturl"), lang);
            string app_waittimes        = Language.Content(B_BaseConfig.Get("app_waittimes"), lang);
            string app_updatetime       = B_BaseConfig.Get("app_updatetime");
            string val = "{\"app_name\":\"" + app_name + "\",\"app_toplogo\":\"" + app_toplogo + "\",\"app_toplogourl\":\"" + app_toplogourl + "\",\"app_lefticon\":\"" + app_lefticon + "\",\"app_lefturl\":\"" + app_lefturl + "\",\"app_righticon\":\"" + app_righticon + "\",\"app_righturl\":\"" + app_righturl + "\",\"app_topbackground\":\"" + app_topbackground + "\",\"app_topline\":\"" + app_topline + "\",\"app_topcolor\":\"" + app_topcolor + "\",\"app_bottombackground\":\"" + app_bottombackground + "\",\"app_bottomline\":\"" + app_bottomline + "\",\"app_bottomcolor\":\"" + app_bottomcolor + "\",\"app_startimage\":\"" + app_startimage + "\",\"app_starturl\":\"" + app_starturl + "\",\"app_waittimes\":\"" + app_waittimes + "\",\"updatetime\":\"" + app_updatetime + "\"}";
            JavaScriptSerializer jss = new JavaScriptSerializer();
            LBAPI api = new LBAPI();

            api.data = val;
            api.msg  = "OK";
            string json = jss.Serialize(api);

            Response.Write(json);
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_BaseConfig bconfig = new B_BaseConfig();

            model = bconfig.LoadConfig();

            if (!EX_Admin.Power("License_set", "账户设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            password = model.LicensePWD;
            if (password != "")
            {
                password = "******";
            }

            string[] arr = model.LicenseDomain.Split(',');
            string   res = "";

            foreach (string str in arr)
            {
                if (str == "")
                {
                    continue;
                }
                if (res == "")
                {
                    res = str;
                }
                else
                {
                    res += "," + str;
                }
            }
            model.LicenseDomain = res;


            string ps = SYS.LicensePackage;
            JavaScriptSerializer jss = new JavaScriptSerializer();
            List <UserService>   services;

            try
            {
                services = jss.Deserialize <List <UserService> >(ps);
            }
            catch
            {
                services = new List <UserService>();
            }
            if (services == null)
            {
                services = new List <UserService>();
            }
            if (services.Count > 0)
            {
                IsBussiness = true;
            }
        }
示例#10
0
        /// <summary>
        /// 设置授权
        /// </summary>
        public void Licence_Set()
        {
            if (!EX_Admin.Power("License_set", "账户设置"))
            {
                AjaxNoPower();
                return;
            }
            string LicenseUserName = RequestTool.RequestString("LicenseUserName");
            string LicensePWD      = RequestTool.RequestString("LicensePWD");

            if (LicensePWD == "******")
            {
                LicensePWD = SYS.LicensePWD;
            }
            string LicenseDomain = RequestTool.RequestString("LicenseDomain").ToLower();

            BaseConfig cf = new BaseConfig();

            cf.LicensePWD      = LicensePWD;
            cf.LicenseUserName = LicenseUserName;
            cf.LicenseDomain   = LicenseDomain;
            B_BaseConfig dob = new B_BaseConfig();

            //============================================
            //获取服务端权限
            LBAPI_Licencse api;

            try
            {
                string res = Shop.LebiAPI.Service.Instanse.License_Set("SetUser", "username="******"&pwd=" + LicensePWD + "&domain=" + LicenseDomain + "&Version=" + ShopCache.GetBaseConfig().Version + "&Version_Son=" + ShopCache.GetBaseConfig().Version_Son + "&code=" + cf.InstallCode);
                JavaScriptSerializer jss = new JavaScriptSerializer();
                api               = jss.Deserialize <LBAPI_Licencse>(res);
                cf.LicenseMD5     = api.md5 == null ? "" : api.md5;
                cf.LicenseString  = api.data == null ? "" : api.data;
                cf.LicenseDomain  = api.domain;
                cf.SpreadCode     = api.spreadcode == null ? "" : api.spreadcode;
                cf.LicensePackage = api.servicepackage == null ? "" : api.servicepackage;
                dob.SaveConfig(cf);
                ////<-{修改Web.config文件让授权即时生效 by lebi.kingdge 2018.10.12
                //string path = base.Server.MapPath("../../Web.config");
                //try
                //{
                //    string contents = string.Empty;
                //    contents = File.ReadAllText(path) + "\r\n";
                //    File.WriteAllText(path, contents);
                //}
                //catch (Exception e) { }
                ////}->
                ShopCache.SetLicense();
                Response.Write("{\"msg\":\"" + api.msg + "\"}");
            }
            catch (Exception ex)
            {
                Response.Write("{\"msg\":\"" + ex.Message + "\"}");
            }
        }
示例#11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("transport_kuaidi100_edit", "快递100配置"))
            {
                WindowNoPower();
            }
            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model = ShopCache.GetBaseConfig();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("appconfig_edit", "APP设置"))
            {
                WindowNoPower();
            }
            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model = ShopCache.GetBaseConfig();
        }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("backup_config", "数据备份配置"))
            {
                WindowNoPower();
            }
            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model    = ShopCache.GetBaseConfig();
            IsEnable = CheckServer();
        }
示例#14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("platformconfig_edit", "第三方平台设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model = ShopCache.GetBaseConfig();
        }
示例#15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("agent_config", "代理-参数设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model = ShopCache.GetBaseConfig();
        }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("tongbu_taobao", "淘宝同步"))
            {
                PageNoPower();
            }


            shopnick = B_BaseConfig.Get("platform_taobao_shopnick");

            dateFrom = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd HH:mm:ss");
            dateTo   = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            inputname = RequestTool.RequestString("n");
            i         = RequestTool.RequestString("i");

            if (inputname == "")
            {
                inputname = "Images";
            }
            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model = ShopCache.GetBaseConfig();
        }
示例#18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("baseconfig_edit", "基本设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model  = ShopCache.GetBaseConfig();
            stepRs = B_BaseConfig.StepR(model.Refund_StepR);
            if (stepRs == null)
            {
                stepRs = new List <BaseConfigStepR>();
            }
        }
示例#19
0
        /// <summary>
        /// 设置授权
        /// </summary>
        public void Licence_Set()
        {
            if (!EX_Admin.Power("License_set", "账户设置"))
            {
                AjaxNoPower();
                return;
            }
            string LicenseUserName = RequestTool.RequestString("LicenseUserName");
            string LicensePWD      = RequestTool.RequestString("LicensePWD");

            if (LicensePWD == "******")
            {
                LicensePWD = SYS.LicensePWD;
            }
            string LicenseDomain = RequestTool.RequestString("LicenseDomain").ToLower();

            BaseConfig cf = new BaseConfig();

            cf.LicensePWD      = LicensePWD;
            cf.LicenseUserName = LicenseUserName;
            cf.LicenseDomain   = LicenseDomain;
            B_BaseConfig dob = new B_BaseConfig();

            //============================================
            //获取服务端权限
            LBAPI_Licencse api;

            try
            {
                string res = Shop.LebiAPI.Service.Instanse.License_Set("SetUser", "username="******"&pwd=" + LicensePWD + "&domain=" + LicenseDomain + "&Version=" + ShopCache.GetBaseConfig().Version + "&Version_Son=" + ShopCache.GetBaseConfig().Version_Son + "&code=" + cf.InstallCode);
                JavaScriptSerializer jss = new JavaScriptSerializer();
                api               = jss.Deserialize <LBAPI_Licencse>(res);
                cf.LicenseMD5     = api.md5 == null ? "" : api.md5;
                cf.LicenseString  = api.data == null ? "" : api.data;
                cf.LicenseDomain  = api.domain;
                cf.SpreadCode     = api.spreadcode == null ? "" : api.spreadcode;
                cf.LicensePackage = api.servicepackage == null ? "" : api.servicepackage;
                dob.SaveConfig(cf);
                ShopCache.SetLicense();
                Response.Write("{\"msg\":\"" + api.msg + "\"}");
            }
            catch (Exception ex)
            {
                Response.Write("{\"msg\":\"" + ex.Message + "\"}");
            }
        }
示例#20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("emailconfig_edit", "编辑邮件设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model    = ShopCache.GetBaseConfig();
            password = model.MailPassWord;
            if (password != "")
            {
                password = "******";
            }
        }
示例#21
0
        public List <BaseConfigAppMenu> Getmenus(string str)
        {
            List <BaseConfigAppMenu> menus;

            try
            {
                menus = B_BaseConfig.AppMenu(str);
                if (menus == null)
                {
                    menus = new List <BaseConfigAppMenu>();
                }
            }
            catch
            {
                menus = new List <BaseConfigAppMenu>();
            }

            return(menus);
        }
示例#22
0
        /// <summary>
        /// 设置授权
        /// 未登录系统时
        /// 为保证安全,此方法只能在未设置时才能使用
        /// </summary>
        public void Licence_Set()
        {
            BaseConfig bcf = ShopCache.GetBaseConfig();

            if (bcf.LicenseUserName != "" && bcf.LicensePWD != "")
            {
                Response.Write("{\"msg\":\"" + Language.Tag("请登录后操作", CurrentLanguage.Code) + "\"}");
                return;
            }
            string     LicenseUserName = RequestTool.RequestString("LicenseUserName");
            string     LicensePWD      = RequestTool.RequestString("LicensePWD");
            string     LicenseDomain   = RequestTool.RequestString("LicenseDomain").ToLower();
            BaseConfig cf = new BaseConfig();

            cf.LicensePWD      = LicensePWD;
            cf.LicenseUserName = LicenseUserName;
            cf.LicenseDomain   = LicenseDomain;
            B_BaseConfig dob = new B_BaseConfig();

            //============================================
            //获取服务端权限
            LBAPI_Licencse api;

            try
            {
                string res = Shop.LebiAPI.Service.Instanse.License_Set("SetUser", "username="******"&pwd=" + LicensePWD + "&domain=" + LicenseDomain + "&Version=" + ShopCache.GetBaseConfig().Version + "&Version_Son=" + ShopCache.GetBaseConfig().Version_Son);
                JavaScriptSerializer jss = new JavaScriptSerializer();
                api = jss.Deserialize <LBAPI_Licencse>(res);
            }
            catch (Exception)
            {
                api = new LBAPI_Licencse();
            }
            if (api.msg == "OK")
            {
                cf.LicenseMD5     = api.md5 == null ? "" : api.md5;
                cf.LicenseString  = api.data == null ? "" : api.data;
                cf.LicensePackage = api.servicepackage == null ? "" : api.servicepackage;
                dob.SaveConfig(cf);
            }
            Response.Write("{\"msg\":\"" + api.msg + "\"}");
        }
示例#23
0
        public string tenpay_notify = "http://*****/payReturnUrl.aspx";    //支付完成后的回调处理页面;

        public TenpayUtil(Lebi_Order order)
        {
            /*tenpay      = System.Configuration.ConfigurationSettings.AppSettings["tenpay"];*/

            Lebi_OnlinePay pay = Shop.Bussiness.Money.GetOnlinePay(order, "tenpayJSDZ");

            if (pay == null)
            {
                return;
            }
            Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id);

            Shop.Bussiness.Site site    = new Shop.Bussiness.Site();
            B_BaseConfig        bconfig = new B_BaseConfig();
            BaseConfig          SYS     = bconfig.LoadConfig();

            bargainor_id  = pay.UserName;
            tenpay_key    = pay.UserKey;
            tenpay_return = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/onlinepay/payReturnUrl.aspx";
            tenpay_notify = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/onlinepay/payNotifyUrl.aspx";
        }
示例#24
0
        /// <summary>
        /// 检查授权信息
        /// </summary>
        public void Taobao_CheckUser()
        {
            LBAPI api = Shop.LebiAPI.Service.Instanse.Taobao_CheckUser();

            if (api == null)
            {
                Response.Write("{\"msg\":\"系统异常\"}");
            }
            else
            {
                if (api.msg == "OK")
                {
                    B_BaseConfig.Set("platform_taobao_shopnick", api.data);
                    Response.Write("{\"msg\":\"OK\",\"nick\":\"" + api.data + "\"}");
                }
                else
                {
                    Response.Write("{\"msg\":\"" + api.msg + "\"}");
                }
            }
        }
示例#25
0
        /// <summary>
        /// 获取App配置
        /// </summary>
        public void AppConfig()
        {
            string lang                      = RequestTool.RequestSafeString("lang", "CN");
            string app_name                  = Language.Content(B_BaseConfig.Get("app_name"), lang);
            string app_lefticon              = "http://" + RequestTool.GetRequestDomain() + Language.Content(B_BaseConfig.Get("app_lefticon"), lang);
            string app_lefturl               = Language.Content(B_BaseConfig.Get("app_lefturl"), lang);
            string app_righticon             = "http://" + RequestTool.GetRequestDomain() + Language.Content(B_BaseConfig.Get("app_righticon"), lang);
            string app_righturl              = Language.Content(B_BaseConfig.Get("app_righturl"), lang);
            string app_toplogo               = "http://" + RequestTool.GetRequestDomain() + Language.Content(B_BaseConfig.Get("app_toplogo"), lang);
            string app_toplogourl            = Language.Content(B_BaseConfig.Get("app_toplogourl"), lang);
            string app_topbackground         = Language.Content(B_BaseConfig.Get("app_topbackground"), lang);
            string app_topcolor              = Language.Content(B_BaseConfig.Get("app_topcolor"), lang);
            string app_topline               = Language.Content(B_BaseConfig.Get("app_topline"), lang);
            string app_bottombackground      = Language.Content(B_BaseConfig.Get("app_bottombackground"), lang);
            string app_bottomcolor           = Language.Content(B_BaseConfig.Get("app_bottomcolor"), lang);
            string app_bottomline            = Language.Content(B_BaseConfig.Get("app_bottomline"), lang);
            string app_bottomcount           = Language.Content(B_BaseConfig.Get("app_bottomcount"), lang);
            string app_startimage            = Language.Content(B_BaseConfig.Get("app_startimage"), lang);
            string app_starturl              = Language.Content(B_BaseConfig.Get("app_starturl"), lang);
            string app_waittimes             = Language.Content(B_BaseConfig.Get("app_waittimes"), lang);
            string app_version               = Language.Content(B_BaseConfig.Get("app_version"), lang);
            string app_downloadurl           = Language.Content(B_BaseConfig.Get("app_downloadurl"), lang);
            string app_updatetime            = B_BaseConfig.Get("app_updatetime");
            string app_share                 = B_BaseConfig.Get("app_share");
            string app_share_qq_key          = B_BaseConfig.Get("app_share_qq_key");
            string app_share_qq_secret       = B_BaseConfig.Get("app_share_qq_secret");
            string app_share_wechat_key      = B_BaseConfig.Get("app_share_wechat_key");
            string app_share_wechat_secret   = B_BaseConfig.Get("app_share_wechat_secret");
            string app_share_dingtalk_key    = B_BaseConfig.Get("app_share_dingtalk_key");
            string app_share_dingtalk_secret = B_BaseConfig.Get("app_share_dingtalk_secret");
            string val = "{\"app_name\":\"" + app_name + "\",\"app_toplogo\":\"" + app_toplogo + "\",\"app_toplogourl\":\"" + app_toplogourl + "\",\"app_lefticon\":\"" + app_lefticon + "\",\"app_lefturl\":\"" + app_lefturl + "\",\"app_righticon\":\"" + app_righticon + "\",\"app_righturl\":\"" + app_righturl + "\",\"app_topbackground\":\"" + app_topbackground + "\",\"app_topline\":\"" + app_topline + "\",\"app_topcolor\":\"" + app_topcolor + "\",\"app_bottombackground\":\"" + app_bottombackground + "\",\"app_bottomline\":\"" + app_bottomline + "\",\"app_bottomcolor\":\"" + app_bottomcolor + "\",\"app_bottomcount\":\"" + app_bottomcount + "\",\"app_startimage\":\"" + app_startimage + "\",\"app_starturl\":\"" + app_starturl + "\",\"app_waittimes\":\"" + app_waittimes + "\",\"app_version\":\"" + app_version + "\",\"app_downloadurl\":\"" + app_downloadurl + "\",\"updatetime\":\"" + app_updatetime + "\",\"share_settings\":{\"app_share\":\"" + app_share + "\",\"qq\":{\"key\":\"" + app_share_qq_key + "\",\"secret\":\"" + app_share_qq_secret + "\"},\"wechat\":{\"key\":\"" + app_share_wechat_key + "\",\"secret\":\"" + app_share_wechat_secret + "\"},\"dingtalk\":{\"key\":\"" + app_share_dingtalk_key + "\",\"secret\":\"" + app_share_dingtalk_secret + "\"}}}";
            JavaScriptSerializer jss = new JavaScriptSerializer();
            LBAPI api = new LBAPI();

            api.data = val;
            api.msg  = "OK";
            string json = jss.Serialize(api);

            Response.Write(json);
        }
示例#26
0
        /// <summary>
        /// 更新插件状态
        /// </summary>
        public void Plugin_updatestatus()
        {
            if (!EX_Admin.Power("pluginconfig_edit", "插件设置"))
            {
                AjaxNoPower();
                return;
            }
            string name   = RequestTool.RequestString("id");
            string status = "";

            string[] arr    = SYS.PluginUsed.Split(',');
            bool     ishave = false;

            foreach (string aname in arr)
            {
                if (aname == name)
                {
                    ishave = true;
                    continue;
                }
                if (aname != "")
                {
                    status += "," + aname;
                }
            }
            if (!ishave)
            {
                //启用一个插件
                status += "," + name;
            }
            B_BaseConfig dob   = new B_BaseConfig();
            BaseConfig   model = new BaseConfig();

            model.PluginUsed = status;
            dob.SaveConfig(model);
            Response.Write("{\"msg\":\"OK\"}");
        }
示例#27
0
        /// <summary>
        /// 解压部署文件
        /// </summary>
        public void Version_FileUpdate()
        {
            if (!EX_Admin.Power("version", "版本管理"))
            {
                AjaxNoPower();
                return;
            }
            int          id        = RequestTool.RequestInt("id");
            int          IsUpdated = RequestTool.RequestInt("IsUpdated", 0);
            Lebi_Version model     = B_Lebi_Version.GetModel(id);

            if (model == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            if (!Shop.LebiAPI.Service.Instanse.ISRightVersion(SYS, model))
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            //if (IsUpdated == 0)
            //{
            if (model.Path_rar != "")
            {
                //文件解包+部署文件
                string nistring = HtmlEngine.ReadTxt("/config/noupdate.txt");
                UpDate.DecompressFile(model.Path_rar, "/", nistring);
                //执行更新程序
                try
                {
                    string url = "http://" + HttpContext.Current.Request.Url.Authority + "/update/update.aspx";
                    string res = HtmlEngine.CetHtml(url);
                    if (res.Contains("OK"))
                    {
                        string ServerPath = System.Web.HttpContext.Current.Server.MapPath("~/");
                        string fileUrl    = ServerPath + "/update/update.aspx";
                        if (File.Exists(fileUrl))
                        {
                            File.Delete(fileUrl);
                        }
                        //fileUrl = ServerPath + "/update.aspx.cs";
                        //if (File.Exists(fileUrl))
                        //{
                        //    File.Delete(fileUrl);
                        //}
                    }
                }
                catch
                {
                }
                //执行sql
                string sqlfile = WebPath + "/update/update.sql";
                if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "access")
                {
                    sqlfile = WebPath + "/update/update_access.sql";
                }
                //string sql = HtmlEngine.ReadTxt(sqlfile);
                //if (sql != null)
                //{
                //    if (sql != "")
                //        Common.ExecuteSql(sql);
                //}
                string fileName = HttpContext.Current.Server.MapPath(@"~/" + sqlfile);
                if (File.Exists(fileName))
                {
                    using (FileStream fs = new FileStream(fileName, FileMode.Open))
                    {
                        using (StreamReader reader = new StreamReader(fs, Encoding.UTF8))
                        {
                            string text = string.Empty;
                            while (!reader.EndOfStream)
                            {
                                try
                                {
                                    text = reader.ReadLine();
                                    if (text != "")
                                    {
                                        Common.ExecuteSql(text);
                                    }
                                }
                                catch { }
                            }
                        }
                    }
                }
            }
            //}
            //if (model.IsTypeUpdate == 1)
            //{
            //    //更新type表
            //    Thread thread = new Thread(new ThreadStart(Shop.LebiAPI.Service.Instanse.UpdateType));
            //    thread.IsBackground = true;
            //    thread.Start();
            //}
            //if (model.IsDBStructUpdate == 1)
            //{
            //    //更新数据库结构
            //    Thread thread = new Thread(new ThreadStart(Shop.LebiAPI.Service.Instanse.UpdateDBBody));
            //    thread.IsBackground = true;
            //    thread.Start();
            //}
            //if (model.IsSystemMenuUpdate == 1)
            //{
            //    //更新系统菜单
            //    Thread thread = new Thread(new ThreadStart(Shop.LebiAPI.Service.Instanse.UpdateMenu));
            //    thread.IsBackground = true;
            //    thread.Start();
            //}
            //if (model.IsThemePageUpdate == 1)
            //{
            //    //更新系统页面
            //    Thread thread = new Thread(new ThreadStart(Shop.LebiAPI.Service.Instanse.UpdateThemePage));
            //    thread.IsBackground = true;
            //    thread.Start();
            //}
            //if (model.IsNodeUpdate == 1)
            //{
            //    //更新系统结点
            //    Thread thread = new Thread(new ThreadStart(Shop.LebiAPI.Service.Instanse.UpdateNode));
            //    thread.IsBackground = true;
            //    thread.Start();
            //}
            //if (model.IsSystemPageUpdate == 1)
            //{
            //    //更新系统页面
            //    Thread thread = new Thread(new ThreadStart(SystemTheme.CreateSystemPage));
            //    thread.IsBackground = true;
            //    thread.Start();
            //}
            //if (model.IsPageUpdate == 1)
            //{
            //    //更新所有前台页面
            //    Thread thread = new Thread(new ThreadStart(Shop.Bussiness.Theme.CreateThemeALL));
            //    thread.IsBackground = true;
            //    thread.Start();
            //}
            //更新版本号
            BaseConfig cf = new BaseConfig();

            cf.Version_Son = model.Version_Son.ToString();
            cf.Version     = model.Version.ToString();
            B_BaseConfig bcf = new B_BaseConfig();

            bcf.SaveConfig(cf);
            model.IsUpdate    = 1;
            model.Time_Update = System.DateTime.Now;
            B_Lebi_Version.Update(model);
            //同步版本号
            Shop.LebiAPI.Service.Instanse.UpdateVersionCode();
            Response.Write("{\"msg\":\"OK\"}");
        }
示例#28
0
        public static string package  = "";                          //进行支付需要的包

        protected void Page_Load(object sender, EventArgs e)
        {
            Lebi_OnlinePay pay = B_Lebi_OnlinePay.GetModel("Code='weixinpay'");

            if (pay == null)
            {
                Log.Add("在线支付接口 weixinpay 配置错误");
                return;
            }
            Shop.Bussiness.Site site    = new Shop.Bussiness.Site();
            B_BaseConfig        bconfig = new B_BaseConfig();
            BaseConfig          SYS     = bconfig.LoadConfig();

            partnerid  = pay.UserName;
            partnerkey = pay.UserKey;
            appid      = SYS.platform_weixin_id;
            appsecret  = SYS.platform_weixin_secret;
            appkey     = "";
            notify_url = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/onlinepay/weixinpay.aspx";

            Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id);
            int           order_id = RequestTool.RequestInt("order_id", 0);
            Lebi_Order    order    = B_Lebi_Order.GetModel(order_id);

            if (order == null)
            {
                Response.Write("订单错误");
                Response.End();
                return;
            }

            string order_price = (order.Money_Pay * currendy.ExchangeRate * 100).ToString();
            string sp_billno   = order.Code;

            Lebi_User user = B_Lebi_User.GetModel(order.User_id);

            if (user == null)
            {
                Response.Write("订单错误");
                Response.End();
                return;
            }
            ///////////////////////////////////////////////////////////////////////////////////////////////
            //当前时间 yyyyMMdd
            string date = DateTime.Now.ToString("yyyyMMdd");

            if (null == sp_billno)
            {
                //生成订单10位序列号,此处用时间和随机数生成,商户根据自己调整,保证唯一
                sp_billno = DateTime.Now.ToString("HHmmss") + TenpayUtil.BuildRandomStr(4);
            }
            else
            {
                sp_billno = Request["order_no"];
            }

            sp_billno = partnerid + sp_billno;


            //创建支付应答对象
            var packageReqHandler = new RequestHandler(Context);

            //初始化
            packageReqHandler.init();

            timeStamp = TenpayUtil.getTimestamp();
            nonceStr  = TenpayUtil.getNoncestr();


            //设置package订单参数

            packageReqHandler.setParameter("body", "test"); //商品信息 127字符
            packageReqHandler.setParameter("appid", user.bind_weixin_id);
            packageReqHandler.setParameter("mch_id", mchid);
            packageReqHandler.setParameter("nonce_str", nonceStr.ToLower());
            packageReqHandler.setParameter("notify_url", notify_url);
            packageReqHandler.setParameter("openid", "openid");
            packageReqHandler.setParameter("out_trade_no", sp_billno);                        //商家订单号
            packageReqHandler.setParameter("spbill_create_ip", Page.Request.UserHostAddress); //用户的公网ip,不是商户服务器IP
            packageReqHandler.setParameter("total_fee", "1");                                 //商品金额,以分为单位(money * 100).ToString()
            packageReqHandler.setParameter("trade_type", "JSAPI");

            //获取package包
            sign = packageReqHandler.CreateMd5Sign("key", appkey);
            WriteFile(Server.MapPath("") + "\\Log.txt", sign);
            packageReqHandler.setParameter("sign", sign);

            string data = packageReqHandler.parseXML();

            WriteFile(Server.MapPath("") + "\\Log.txt", data);

            string prepayXml = HttpUtil.Send(data, "https://api.mch.weixin.qq.com/pay/unifiedorder");

            WriteFile(Server.MapPath("") + "\\Log.txt", prepayXml);

            //获取预支付ID
            var xdoc = new XmlDocument();

            xdoc.LoadXml(prepayXml);
            XmlNode     xn  = xdoc.SelectSingleNode("xml");
            XmlNodeList xnl = xn.ChildNodes;

            if (xnl.Count > 7)
            {
                prepayId = xnl[7].InnerText;
                package  = string.Format("prepay_id={0}", prepayId);
                WriteFile(Server.MapPath("") + "\\Log.txt", package);
            }

            //设置支付参数
            var paySignReqHandler = new RequestHandler(Context);

            paySignReqHandler.setParameter("appId", appId);
            paySignReqHandler.setParameter("timeStamp", timeStamp);
            paySignReqHandler.setParameter("nonceStr", nonceStr);
            paySignReqHandler.setParameter("package", package);
            paySignReqHandler.setParameter("signType", "MD5");
            paySign = paySignReqHandler.CreateMd5Sign("key", appkey);


            WriteFile(Server.MapPath("") + "\\Log.txt", paySign);
        }