| | |
| | | options.AddPolicy("AllowAll", builder => |
| | | { |
| | | builder.AllowAnyOrigin() |
| | | .AllowAnyMethod() |
| | | .AllowAnyHeader(); |
| | | .AllowAnyMethod() |
| | | .AllowAnyHeader(); |
| | | }); |
| | | }); |
| | | builder.Services.AddCustomConvention(); |
| | |
| | | //添加安全定义 |
| | | c.AddSecurityDefinition("Token", new OpenApiSecurityScheme |
| | | { |
| | | Description = |
| | | "请输入token,格式为:token 3fa85f64-5717-4562-b3fc-2c963f66afa6(注意中间必须有空格)", |
| | | Description ="请输入token,格式为:token 3fa85f64-5717-4562-b3fc-2c963f66afa6(注意中间必须有空格)", |
| | | Name = "token", |
| | | In = ParameterLocation.Header, |
| | | Type = SecuritySchemeType.ApiKey, |
| | |
| | | }); |
| | | //添加上传路径 |
| | | var _upPath = AppContext.BaseDirectory + |
| | | AppSettingsHelper.getValueByKey("UploadPath"); |
| | | AppSettingsHelper.getValueByKey("UploadPath"); |
| | | app.UseStaticFiles(new StaticFileOptions |
| | | { |
| | | FileProvider = new PhysicalFileProvider(_upPath), |