mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修复swagger接口文档中schema不正确的问题
This commit is contained in:
parent
4a043cf4be
commit
19ae06d4ec
|
|
@ -20,3 +20,10 @@ class CustomSwaggerAutoSchema(SwaggerAutoSchema):
|
|||
if "api" in tags and operation_keys:
|
||||
return [tags_dict.get(operation_keys[1]) if operation_keys[1] in tags_dict else operation_keys[1]]
|
||||
return tags
|
||||
def get_schema(self, request=None, public=False):
|
||||
schema = super().get_schema(request, public)
|
||||
if request.is_secure():
|
||||
schema.schemes = ['https']
|
||||
else:
|
||||
schema.schemes = ['http']
|
||||
return schema
|
||||
|
|
@ -26,6 +26,8 @@ DATABASES = {
|
|||
'default': CONFIG.get_db_setting()
|
||||
}
|
||||
|
||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue