Commit ac89a91e authored by 黄奎's avatar 黄奎

页面修改

parent b300bb1d
...@@ -1896,22 +1896,30 @@ namespace Mall.Model.Extend.MarketingCenter ...@@ -1896,22 +1896,30 @@ namespace Mall.Model.Extend.MarketingCenter
public class quicknavDetailsItem public class quicknavDetailsItem
{ {
public bool opened { get; set; } public bool opened { get; set; }
public string picUrl { get; set; } public string picUrl { get; set; }
public string number { get; set; } public string number { get; set; }
public string appId { get; set; } public string appId { get; set; }
public string page { get; set; } public string page { get; set; }
public string address { get; set; } public string address { get; set; }
public string location { get; set; } public string location { get; set; }
public string open_type { get; set; } public string open_type { get; set; }
public string link_url { get; set; } public string link_url { get; set; }
public string key { get; set; } public string key { get; set; }
public string @params { get; set; } //public string @params { get; set; }
} }
......
...@@ -33,10 +33,10 @@ namespace Mall.WebApi.Filter ...@@ -33,10 +33,10 @@ namespace Mall.WebApi.Filter
//记录错误日志 //记录错误日志
if (context.HttpContext.Items[GlobalKey.UserPostInfo] != null) if (context.HttpContext.Items[GlobalKey.UserPostInfo] != null)
{ {
LogHelper.Error($"InvokeServiceMethod请求地址:{Config.GetFilePath(context.HttpContext.Request.GetAbsoluteUri())},请求参数:{JsonConvert.SerializeObject(context.HttpContext.Items[GlobalKey.UserPostInfo].ToString())}", context.Exception); LogHelper.Error($"ApiExceptionFilterAttribute_InvokeServiceMethod请求地址:{Config.GetFilePath(context.HttpContext.Request.GetAbsoluteUri())},请求参数:{JsonConvert.SerializeObject(context.HttpContext.Items[GlobalKey.UserPostInfo].ToString())}", context.Exception);
} }
else { else {
LogHelper.Error($"InvokeServiceMethod请求地址:{Config.GetFilePath(context.HttpContext.Request.GetAbsoluteUri())}", context.Exception); LogHelper.Error($"ApiExceptionFilterAttribute_InvokeServiceMethod请求地址:{Config.GetFilePath(context.HttpContext.Request.GetAbsoluteUri())}", context.Exception);
} }
var robj= new ApiResult() var robj= new ApiResult()
......
...@@ -40,9 +40,7 @@ namespace Mall.WebApi.Filter ...@@ -40,9 +40,7 @@ namespace Mall.WebApi.Filter
//请求参数 //请求参数
JObject parm = new JObject(); JObject parm = new JObject();
string token = ""; string token = "";
#region api监控日志
parm = DoApiMonitorLog(actionContext, ref token); parm = DoApiMonitorLog(actionContext, ref token);
#endregion
bool isCheckToken = true; bool isCheckToken = true;
var endpoint = actionContext.HttpContext.Features.Get<IEndpointFeature>()?.Endpoint; var endpoint = actionContext.HttpContext.Features.Get<IEndpointFeature>()?.Endpoint;
if (endpoint != null && endpoint.Metadata.GetMetadata<AllowAnonymousAttribute>() != null) if (endpoint != null && endpoint.Metadata.GetMetadata<AllowAnonymousAttribute>() != null)
...@@ -50,8 +48,6 @@ namespace Mall.WebApi.Filter ...@@ -50,8 +48,6 @@ namespace Mall.WebApi.Filter
isCheckToken = false; isCheckToken = false;
} }
#region Token校验 #region Token校验
if (isCheckToken) if (isCheckToken)
...@@ -141,16 +137,26 @@ namespace Mall.WebApi.Filter ...@@ -141,16 +137,26 @@ namespace Mall.WebApi.Filter
JObject parm = new JObject(); JObject parm = new JObject();
var request = actionContext.HttpContext.Request; var request = actionContext.HttpContext.Request;
#region 如果参数是json实体对象,获取序列化后的数据 #region 如果参数是json实体对象,获取序列化后的数据
request.EnableBuffering();//重置读取
request.Body.Seek(0, SeekOrigin.Begin);
request.Body.Position = 0;
Stream stream = request.Body;
Encoding encoding = Encoding.UTF8;
if (request.ContentLength > 0) if (request.ContentLength > 0)
{ {
byte[] buffer = new byte[request.ContentLength.Value]; string responseData = "";
stream.Read(buffer, 0, buffer.Length); string data = "";
string responseData = Encoding.UTF8.GetString(buffer); //多次读取Request.Body
using (MemoryStream ms = new MemoryStream())
{
request.Body.CopyToAsync(ms);
//设置当前流的位置为0
ms.Seek(0, SeekOrigin.Begin);
//这里ReadToEnd执行完毕后requestBodyStream流的位置会从0到最后位置(即request.ContentLength)
data = new StreamReader(ms, Encoding.UTF8).ReadToEnd();
//设置当前流的位置为0
ms.Seek(0, SeekOrigin.Begin);
request.Body = ms;
StreamReader sr = new StreamReader(request.Body);
responseData = sr.ReadToEnd();
}
if (!string.IsNullOrWhiteSpace(responseData.Trim())) if (!string.IsNullOrWhiteSpace(responseData.Trim()))
{ {
try try
...@@ -306,39 +312,6 @@ namespace Mall.WebApi.Filter ...@@ -306,39 +312,6 @@ namespace Mall.WebApi.Filter
//TODO查询用户权限 //TODO查询用户权限
string url = actionContext.HttpContext.Request.GetAbsoluteUri(); string url = actionContext.HttpContext.Request.GetAbsoluteUri();
bool havPermission = true; bool havPermission = true;
//List<object> args = new List<object>() {
// uid
//};
//根据uid 判断用户是否拥有该权限
//Type type = (Type)_obj;
//MethodInfo meth = type.GetMethod(model.Method);
//try
//{
// permission = (string)meth.Invoke(Activator.CreateInstance(type), args.ToArray());
//}
//catch
//{
//}
//if (!string.IsNullOrWhiteSpace(permission))
//{
// if (permission.ToLower().Contains(url.ToLower()))
// {
// havPermission = true;
// }
// else//判断菜单是否存在
// {
// bool systemIsExit = RbUserCache.GetSystemHasMenu(url.ToLower());
// if (!systemIsExit)
// {
// havPermission = true;
// }
// }
//}
if (havPermission == false) if (havPermission == false)
{ {
actionContext.Result = new Microsoft.AspNetCore.Mvc.JsonResult( actionContext.Result = new Microsoft.AspNetCore.Mvc.JsonResult(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment