mirror of
https://github.com/CoreUnion/CoreShop.git
synced 2026-10-28 12:48:40 +08:00
调整全局错误返回提示语
This commit is contained in:
@@ -43,7 +43,7 @@ namespace CoreCms.Net.Filter
|
||||
//处理各种异常
|
||||
var jm = new AdminUiCallBack();
|
||||
jm.code = (int)status;
|
||||
jm.msg = "发生了全局异常请联系管理员";
|
||||
jm.msg = "系统异常,请查看错误描述并进行解决。";
|
||||
jm.data = context.Exception;
|
||||
context.ExceptionHandled = true;
|
||||
context.Result = new ObjectResult(jm);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Filter
|
||||
{
|
||||
status = false,
|
||||
code = (int)status,
|
||||
msg = "发生了全局异常,请联系管理员",
|
||||
msg = "系统返回异常,请联系管理员进行处理!",
|
||||
data = context.Exception
|
||||
};
|
||||
context.ExceptionHandled = true;
|
||||
|
||||
@@ -65,8 +65,10 @@ namespace CoreCms.Net.Loging
|
||||
/// <param name="exception">异常</param>
|
||||
public static void WriteAll(LogLevel logLevel, LogType logType, string logTitle, string message, Exception exception = null)
|
||||
{
|
||||
WriteDbLog(logLevel, logType, logTitle, message, exception);
|
||||
//先存文件
|
||||
WriteFileLog(logLevel, logType, logTitle, message, exception);
|
||||
//后存数据库
|
||||
WriteDbLog(logLevel, logType, logTitle, message, exception);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -15,9 +15,11 @@ using CoreCms.Net.Caching.AutoMate.RedisCache;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Essensoft.Paylink.WeChatPay;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.Options;
|
||||
using ToolGood.Words;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin.Controllers
|
||||
@@ -28,11 +30,11 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
//[DisableCors]
|
||||
public class DemoController : Controller
|
||||
{
|
||||
private readonly IToolsServices _toolsServices;
|
||||
private readonly IOptions<WeChatPayOptions> _optionsAccessor;
|
||||
|
||||
public DemoController(IToolsServices toolsServices)
|
||||
public DemoController(IOptions<WeChatPayOptions> optionsAccessor)
|
||||
{
|
||||
_toolsServices = toolsServices;
|
||||
_optionsAccessor = optionsAccessor;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +42,12 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
/// 默认首页
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IActionResult> Index()
|
||||
public IActionResult Index()
|
||||
{
|
||||
var t = await _toolsServices.IllegalWordsReplace("测试");
|
||||
var outData = _optionsAccessor.Value;
|
||||
|
||||
//return Content(t);
|
||||
return Content(t.ToString());
|
||||
return Json(outData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers.PayNotify
|
||||
private readonly ICoreCmsBillRefundServices _billRefundServices;
|
||||
private readonly IWeChatPayNotifyClient _client;
|
||||
private readonly IOptions<WeChatPayOptions> _optionsAccessor;
|
||||
private IRedisOperationRepository _redisOperationRepository;
|
||||
private readonly IRedisOperationRepository _redisOperationRepository;
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user