Exemple #1
0
        public ActionResult Upload(UploadModel model)
        {
            if (ModelState.IsValid)
            {
                SiteConfigInfo siteConfigInfo = BSConfig.SiteConfig;

                siteConfigInfo.UploadImgType           = model.UploadImgType;
                siteConfigInfo.UploadImgSize           = model.UploadImgSize * 1000;
                siteConfigInfo.UploadAttType           = model.UploadAttType;
                siteConfigInfo.UploadAttSize           = model.UploadAttSize * 1000;
                siteConfigInfo.WatermarkType           = model.WatermarkType;
                siteConfigInfo.WatermarkQuality        = model.WatermarkQuality;
                siteConfigInfo.WatermarkPosition       = model.WatermarkPosition;
                siteConfigInfo.WatermarkImg            = model.WatermarkImg == null ? "" : model.WatermarkImg;
                siteConfigInfo.WatermarkImgOpacity     = model.WatermarkImgOpacity;
                siteConfigInfo.WatermarkText           = model.WatermarkText == null ? "" : model.WatermarkText;
                siteConfigInfo.WatermarkTextFont       = model.WatermarkTextFont;
                siteConfigInfo.WatermarkTextSize       = model.WatermarkTextSize;
                siteConfigInfo.ArticleImgThumbSize     = model.ArticleImgThumbSize;
                siteConfigInfo.FriendLinkThumbSize     = model.FriendLinkThumbSize;
                siteConfigInfo.ArticleClassThumbSize   = model.ArticleClassThumbSize;
                siteConfigInfo.SpecialImgThumbSize     = model.SpecialImgThumbSize;
                siteConfigInfo.UserAvatarThumbSize     = model.UserAvatarThumbSize;
                siteConfigInfo.UserRankAvatarThumbSize = model.UserRankAvatarThumbSize;

                BSConfig.SaveSiteConfig(siteConfigInfo);
                //Emails.ResetShop();
                //SMSes.ResetShop();
                AddAdminOperateLog("修改上传设置");
                return(PromptView(Url.Action("upload"), "修改上传设置成功"));
            }

            LoadFont();
            return(View(model));
        }
Exemple #2
0
        public ActionResult Site(SetModel model)
        {
            if (ModelState.IsValid)
            {
                SiteConfigInfo siteCofnigInfo = BSConfig.SiteConfig;

                siteCofnigInfo.SiteName       = model.SiteName == null ? "" : model.SiteName;
                siteCofnigInfo.SiteUrl        = model.SiteUrl == null ? "" : model.SiteUrl;
                siteCofnigInfo.SiteTitle      = model.SiteTitle == null ? "" : model.SiteTitle;
                siteCofnigInfo.SEOKeyword     = model.SEOKeyword == null ? "" : model.SEOKeyword;
                siteCofnigInfo.SEODescription = model.SEODescription == null ? "" : model.SEODescription;
                siteCofnigInfo.ICP            = model.ICP == null ? "" : model.ICP;
                siteCofnigInfo.Script         = model.Script == null ? "" : model.Script;
                siteCofnigInfo.IsLicensed     = model.IsLicensed;

                BSConfig.SaveSiteConfig(siteCofnigInfo);
                return(PromptView(Url.Action("site"), "修改站点信息成功"));
            }
            return(View(model));
        }