コード例 #1
0
        public ActionResult BasicSettings()
        {
            var settings = SiteSettingApplication.SiteSettings;

            if (string.IsNullOrEmpty(settings.WeixinToken))
            {
                settings.WeixinToken = CreateKey(8);
                SiteSettingApplication.SaveChanges();
            }
            var siteSettingMode = new SiteSettingModel()
            {
                WeixinAppId     = string.IsNullOrEmpty(settings.WeixinAppId) ? string.Empty : settings.WeixinAppId.Trim(),
                WeixinAppSecret = string.IsNullOrEmpty(settings.WeixinAppSecret) ? string.Empty : settings.WeixinAppSecret.Trim(),
                WeixinToKen     = settings.WeixinToken.Trim()
            };

            ViewBag.Url = String.Format("{0}/m-Weixin/WXApi", CurrentUrlHelper.CurrentUrlNoPort());
            //TODO:演示站处理
            //如果是演示站,支付方式参数做特别处理
            if (DemoAuthorityHelper.IsDemo())
            {
                siteSettingMode.WeixinAppId     = "*".PadRight(siteSettingMode.WeixinAppId.Length, '*');
                siteSettingMode.WeixinAppSecret = "*".PadRight(siteSettingMode.WeixinAppSecret.Length, '*');
                ViewBag.isDemo = true;
            }
            return(View(siteSettingMode));
        }
コード例 #2
0
 public JsonResult ChangePassWord(long id, string password)
 {
     if (DemoAuthorityHelper.IsDemo())
     {
         var manager = _iMemberService.GetMember(id);
         if (manager.UserName.ToLower() == "selleradmin")
         {
             return(Json(new Result()
             {
                 success = false, msg = "演示数据禁止修改!"
             }));
         }
     }
     if (password.Trim().Length < 6 || password.Trim().Length > 20)
     {
         return(Json(new Result()
         {
             success = false, msg = "密码在6-20位之间,不能包含空格!"
         }));
     }
     password = password.Trim();
     _iMemberService.ChangePassword(id, password);
     return(Json(new Result()
     {
         success = true, msg = "修改成功!"
     }));
 }
コード例 #3
0
        /// <summary>
        /// 基本设置
        /// </summary>
        /// <returns></returns>
        public ActionResult BasicSettings()
        {
            SiteSettingsInfo siteSettings = this._iSiteSettingService.GetSiteSettings();

            if (string.IsNullOrEmpty(siteSettings.WeixinToken))
            {
                siteSettings.WeixinToken = this.CreateKey(8);
                this._iSiteSettingService.SetSiteSettings(siteSettings);
            }
            SiteSettingModel model = new SiteSettingModel
            {
                WeixinAppId     = string.IsNullOrEmpty(siteSettings.WeixinAppId) ? string.Empty : siteSettings.WeixinAppId.Trim(),
                WeixinAppSecret = string.IsNullOrEmpty(siteSettings.WeixinAppSecret) ? string.Empty : siteSettings.WeixinAppSecret.Trim(),
                WeixinToKen     = siteSettings.WeixinToken.Trim()
            };

            ((dynamic)base.ViewBag).Url = string.Format("{0}/m-Weixin/WXApi", CurrentUrlHelper.CurrentUrlNoPort());
            if (DemoAuthorityHelper.IsDemo())
            {
                model.WeixinAppId              = "*".PadRight(model.WeixinAppId.Length, '*');
                model.WeixinAppSecret          = "*".PadRight(model.WeixinAppSecret.Length, '*');
                ((dynamic)base.ViewBag).isDemo = true;
            }
            return(base.View(model));
        }
コード例 #4
0
        public ActionResult BasicSettings()
        {
            var siteSetting = _iSiteSettingService.GetSiteSettings();

            if (string.IsNullOrEmpty(siteSetting.WeixinToken))
            {
                siteSetting.WeixinToken = CreateKey(8);
                _iSiteSettingService.SetSiteSettings(siteSetting);
            }
            var siteSettingMode = new SiteSettingModel()
            {
                WeixinAppId     = string.IsNullOrEmpty(siteSetting.WeixinAppId) ? string.Empty : siteSetting.WeixinAppId.Trim(),
                WeixinAppSecret = string.IsNullOrEmpty(siteSetting.WeixinAppSecret) ? string.Empty : siteSetting.WeixinAppSecret.Trim(),
                WeixinToKen     = siteSetting.WeixinToken.Trim()
            };

            ViewBag.Url = String.Format("http://{0}/m-Weixin/WXApi", Request.Url.Host);
            //TODO:演示站处理
            //如果是演示站,支付方式参数做特别处理
            if (DemoAuthorityHelper.IsDemo())
            {
                siteSettingMode.WeixinAppId     = "*".PadRight(siteSettingMode.WeixinAppId.Length, '*');
                siteSettingMode.WeixinAppSecret = "*".PadRight(siteSettingMode.WeixinAppSecret.Length, '*');
                ViewBag.isDemo = true;
            }
            return(View(siteSettingMode));
        }
コード例 #5
0
        public JsonResult SaveWeiXinSettings(string weixinAppId, string WeixinAppSecret)
        {
            //TODO:演示站处理
            if (DemoAuthorityHelper.IsDemo())
            {
                return(Json(new { success = false, msg = "演示站点自动隐藏此参数,且不能保存!" }));
            }
            Result result   = new Result();
            var    settings = SiteSettingApplication.SiteSettings;

            settings.WeixinAppId     = weixinAppId.Trim();
            settings.WeixinAppSecret = WeixinAppSecret.Trim();
            SiteSettingApplication.SaveChanges();
            result.success = true;
            return(Json(result));
        }
コード例 #6
0
        public JsonResult SaveWeiXinSettings(string weixinAppId, string WeixinAppSecret)
        {
            //TODO:演示站处理
            if (DemoAuthorityHelper.IsDemo())
            {
                return(Json(new { success = false, msg = "演示站点自动隐藏此参数,且不能保存!" }));
            }
            Result result      = new Result();
            var    siteSetting = _iSiteSettingService.GetSiteSettings();

            siteSetting.WeixinAppId     = weixinAppId.Trim();
            siteSetting.WeixinAppSecret = WeixinAppSecret.Trim();
            _iSiteSettingService.SetSiteSettings(siteSetting);
            result.success = true;
            return(Json(result));
        }
コード例 #7
0
ファイル: ManagerController.cs プロジェクト: pmbdlw/Mall-1
 public JsonResult ChangePassWord(long id, string password, long roleId)
 {
     if (DemoAuthorityHelper.IsDemo())
     {
         var manager = _iManagerService.GetPlatformManager(id);
         if (manager.UserName.ToLower() == "admin")
         {
             return(Json(new Result()
             {
                 success = false, msg = "演示数据禁止修改!"
             }));
         }
     }
     _iManagerService.ChangePlatformManagerPassword(id, password, roleId);
     return(Json(new Result()
     {
         success = true, msg = "修改成功!"
     }));
 }
コード例 #8
0
        public JsonResult SaveWeiXinSettings(string weixinAppId, string WeixinAppSecret)
        {
            if (DemoAuthorityHelper.IsDemo())
            {
                return(this.Json((object)new
                {
                    success = false,
                    msg = "演示站点自动隐藏此参数,且不能保存!"
                }));
            }
            BaseController.Result result       = new BaseController.Result();
            SiteSettingsInfo      siteSettings = this._iSiteSettingService.GetSiteSettings();

            siteSettings.WeixinAppId     = weixinAppId.Trim();
            siteSettings.WeixinAppSecret = WeixinAppSecret.Trim();
            this._iSiteSettingService.SetSiteSettings(siteSettings);
            result.success = true;
            return(this.Json((object)result));
        }