105040 调整中间件优先级,处理预检请求
This commit is contained in:
parent
873d7bbd01
commit
f64b4e47c3
|
|
@ -17,7 +17,7 @@ public class PermissionMiddleware : ILFlowMiddleware
|
|||
/// <summary>
|
||||
/// 优先级
|
||||
/// </summary>
|
||||
public int Priority => 2;
|
||||
public int Priority => 1;
|
||||
|
||||
/// <summary>
|
||||
/// 执行入口
|
||||
|
|
@ -45,6 +45,11 @@ public class PermissionMiddleware : ILFlowMiddleware
|
|||
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