swagger新增加授权jwt
This commit is contained in:
@@ -96,8 +96,17 @@ namespace ZR.Admin.WebApi
|
|||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ע<EFBFBD><D7A2>
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ע<EFBFBD><D7A2>
|
||||||
c.IncludeXmlComments(Path.Combine(CurrentEnvironment.ContentRootPath, "ZRAdmin.xml"), true);
|
c.IncludeXmlComments(Path.Combine(CurrentEnvironment.ContentRootPath, "ZRAdmin.xml"), true);
|
||||||
//}
|
//}
|
||||||
|
c.AddSecurityDefinition("Bearer",
|
||||||
|
new OpenApiSecurityScheme
|
||||||
|
{
|
||||||
|
In = ParameterLocation.Header,
|
||||||
|
Description = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>OAuth<74>ӿڷ<D3BF><DAB7>ص<EFBFBD>Token<65><6E>ǰ<EFBFBD><C7B0>Bearer<65><72>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>Bearer {Token}",
|
||||||
|
Name = "Authorization",//jwtĬ<74>ϵIJ<CFB5><C4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||||
|
Type = SecuritySchemeType.ApiKey, //ָ<><D6B8>ApiKey
|
||||||
|
BearerFormat = "JWT",//<2F><>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶĸ<C6B5>ʽ <20><><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>Ҫ<EFBFBD>dz<EFBFBD><C7B3><EFBFBD><EFBFBD>ĵ<EFBFBD>Ŀ<EFBFBD><C4BF>
|
||||||
|
Scheme = JwtBearerDefaults.AuthenticationScheme//<2F><>Ȩ<EFBFBD><C8A8>Ҫʹ<D2AA>õ<EFBFBD>HTTP<54><50>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
|
|||||||
Reference in New Issue
Block a user