0
我在流明中有基本身份验证Api。对于那个Api我整合Swagger-ui使用下面的url:https://github.com/DarkaOnLine/SwaggerLume头部没有发送基本身份验证为swagger-lume
在swagger UI中启用自定义标头。我们做了改变以下2个文件
1招摇,lume.php
'headers' => [
/*
|--------------------------------------------------------------------------
| Uncomment to add response headers when swagger is generated
|--------------------------------------------------------------------------
*/
/*"view" => [
'Content-Type' => 'text/plain'
],*/
/*
|--------------------------------------------------------------------------
| Uncomment to add request headers when swagger performs requests
|--------------------------------------------------------------------------
*/
"request" => [
'Authorization ' => 'Basic YWRtaW46YWRtaW4='
],
],
2.生成的代码index.blade.php如下
basicAuth= "Basic " + btoa("admin:admin");
swaggerUi.api.clientAuthorizations.add("key", new SwaggerClient.ApiKeyAuthorization("Authorization", basicAuth, "header"));
但头没有发送请求。请检查下面的图片以供参考
请建议,如何解决这个问题。