105040 调整中间件优先级,处理预检请求
This commit is contained in:
parent
873d7bbd01
commit
f64b4e47c3
|
|
@ -17,7 +17,7 @@ public class PermissionMiddleware : ILFlowMiddleware
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 优先级
|
/// 优先级
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Priority => 2;
|
public int Priority => 1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 执行入口
|
/// 执行入口
|
||||||
|
|
@ -45,6 +45,11 @@ public class PermissionMiddleware : ILFlowMiddleware
|
||||||
await context.Response.WriteAsync(JsonConvert.SerializeObject(ApiResult<object>.FailResult("无权限!", 100501)));
|
await context.Response.WriteAsync(JsonConvert.SerializeObject(ApiResult<object>.FailResult("无权限!", 100501)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 预检请求
|
||||||
|
if (context.Request.Method == "OPTIONS")
|
||||||
|
{
|
||||||
|
await next();
|
||||||
|
// context.Response.StatusCode = StatusCodes.Status200OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue