We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
上传文件接口测试的时候,如果先在swagger-ui中选定文件,再在编辑器或其他软件中修改了文件内容并保存,然后再测试接口会有 TypeError: Failed to fetch 的错误,这时就需要刷新swagger-ui,刷新了swagger-ui后配置的token方式的Authorize就失效了。看了提供的配置项好像不能解决这个问题。
swagger 配置: swagger: enabled: true title:xxxxx description: version: xxxxx contact.name: xxxxxx base-package: xxxxxx base-path: /api/,/rest/ exclude-path: /error, /ops/** authorization: name: Authorization # 鉴权策略ID,对应 SecurityReferences ID type: ApiKey # 鉴权策略,可选 ApiKey | BasicAuth | None,默认ApiKey key-name: token # 鉴权传递的Header参数
swagger-spring-boot-starter 版本:1.9.1.RELEASE
Rest 层 @PostMapping("/excel/import") public Rimport(@RequestParam("uploadFile") MultipartFile file) { checkUploadFile(file, ".xlsx"); return new R<>(xxxService.doImport(currentUser(), file)); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
上传文件接口测试的时候,如果先在swagger-ui中选定文件,再在编辑器或其他软件中修改了文件内容并保存,然后再测试接口会有 TypeError: Failed to fetch 的错误,这时就需要刷新swagger-ui,刷新了swagger-ui后配置的token方式的Authorize就失效了。看了提供的配置项好像不能解决这个问题。
swagger 配置:
swagger:
enabled: true
title:xxxxx
description:
version: xxxxx
contact.name: xxxxxx
base-package: xxxxxx
base-path: /api/,/rest/
exclude-path: /error, /ops/**
authorization:
name: Authorization # 鉴权策略ID,对应 SecurityReferences ID
type: ApiKey # 鉴权策略,可选 ApiKey | BasicAuth | None,默认ApiKey
key-name: token # 鉴权传递的Header参数
swagger-spring-boot-starter 版本:1.9.1.RELEASE
Rest 层
@PostMapping("/excel/import")
public Rimport(@RequestParam("uploadFile") MultipartFile file) {
checkUploadFile(file, ".xlsx");
return new R<>(xxxService.doImport(currentUser(), file));
}
The text was updated successfully, but these errors were encountered: