增加授权

This commit is contained in:
18942506660
2024-06-14 09:48:58 +08:00
parent fb95cccae2
commit 8d17b858ee

View File

@@ -47,7 +47,9 @@ namespace WMS.Web.Repositories.DependencyInjection
string authorization = context.Request.Headers["Authorization"];
string path = context.Request.Path.Value.ToLower();
string[] pathlist = path.Split('/');
bool isLogin = pathlist.Where(x => x == "login" || x.ToLower() == "heart" || x.ToLower() == "test" || x.ToLower() == "serialnumber" || x.ToLower() == "barcode").Any();
bool isLogin = pathlist.Where(x => x == "login" || x.ToLower() == "heart"
|| x.ToLower() == "test" || x.ToLower() == "serialnumber" || x.ToLower() == "barcode" ||
x.ToLower() == "swagger").Any();
if (isLogin)
{
context.Response.StatusCode = 200;