Esempio n. 1
0
        public async Task <IActionResult> EditPost()
        {
            var data = new Dictionary <string, object>();

            foreach (string name in Request.Form.Keys)
            {
                var value = Request.Form[name];
                data.Add(name, Request.Form[name].ToString());
            }
            int x = await oms.UpdateAsync(data);

            if (x > 0)
            {
                Alert.Content = string.Format("成功更新 {0} 项设置", x);
                //更新缓存
                await optionsCache.Refresh();
            }
            else
            {
                Alert.Content = "更新设置失败";
                Alert.Level   = AlertModel.AlertType.Danger;
            }

            return(RedirectToAction(nameof(Index)));
        }
Esempio n. 2
0
        public async Task <IActionResult> RefCache()
        {
            Alert.Content = "站点缓存已更新";
            Alert.Level   = Models.AlertModel.AlertType.Success;
            await pageCache.Refresh();

            await optionsCache.Refresh();

            return(RedirectToAction(nameof(Index)));
        }