Skip to content

Commit

Permalink
Merge pull request #1114 from longguikeji/release-2.5.1-beta
Browse files Browse the repository at this point in the history
Release 2.5.1 beta
  • Loading branch information
notevery committed Aug 1, 2022
2 parents ee8a7d9 + e3aafd9 commit 4d88685
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/v1/schema/mine.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MineSwitchTenantItem(Schema):
title=_("租户ID")
)

slug:str = Field(
slug:Optional[str] = Field(
title=_("租户SLUG")
)
class MineSwitchTenantOut(ResponseSchema):
Expand Down
12 changes: 8 additions & 4 deletions api/v1/schema/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,18 @@ class TenantConfigUpdateIn(Schema):
title=_("租户名称"),
)

slug: str = Field(
slug: Optional[str] = Field(
title=_("slug")
)

icon: str = Field(
icon: Optional[str] = Field(
title=_("图标")
)


token_duration_minutes: Optional[int] = Field(
title=_('Token有效时长(分钟)')
)

class TenantConfigUpdateOut(ResponseSchema):
pass

Expand All @@ -105,7 +109,7 @@ class SwitchTenantItem(Schema):
title=_("租户ID")
)

slug:str = Field(
slug:Optional[str] = Field(
title=_("租户SLUG")
)
class TenantLogoutOut(ResponseSchema):
Expand Down
4 changes: 3 additions & 1 deletion api/v1/views/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def get_tenant_config(request, tenant_id: str):
def update_tenant_config(request, tenant_id: str,data:TenantConfigUpdateIn):
""" 编辑租户配置
"""
tenant = get_object_or_404(Tenant.expand_objects,id=tenant_id)
tenant = get_object_or_404(Tenant.objects,id=tenant_id)
if tenant.is_platform_tenant:
data.slug = ''
for attr, value in data.dict().items():
setattr(tenant, attr, value)
tenant.save()
Expand Down
1 change: 1 addition & 0 deletions arkid.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name = "demo arkid"
# host = 'ngarkid.vaiwan.com'
host = 'localhost:8000'
frontend_host = 'localhost:9528'
backend_host = 'localhost:8000'
https_enabled = 0

[email]
Expand Down
2 changes: 1 addition & 1 deletion arkid/common/arkstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_saas_token(tenant, token, use_cache=True):
if use_cache and key in arkid_saas_token_cache:
return arkid_saas_token_cache[key]
app = Application.objects.filter(name='arkid_saas', uuid = tenant.id).first()
host = get_app_config().get_host()
host = get_app_config().get_backend_host()
url = f"{host}/api/v1/tenant/{tenant.id.hex}/app/{tenant.id.hex}/oauth/authorize/"
nonce = uuid.uuid4().hex
params = {
Expand Down
6 changes: 6 additions & 0 deletions arkid/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __init__(self, filename=None):
self.name = data.get('name')
self.host = data.get('host')
self.frontend_host = data.get('frontend_host')
self.backend_host = data.get('backend_host')
self.https_enabled = data.get('https_enabled')

self.extension = ExtensionConfig(
Expand Down Expand Up @@ -70,6 +71,11 @@ def get_frontend_host(self, schema=True):

return self.frontend_host

def get_backend_host(self):
return '{}://{}'.format(
'http', self.backend_host
)

def get_slug_frontend_host(self, slug, schema=True):
if schema:
return '{}://{}.{}'.format(
Expand Down
2 changes: 1 addition & 1 deletion docs/ 快速开始/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ celery启动完毕后再启动 Django server
## 私有化部署

[通过ArkOS部署(推荐)](./%20私有化部署/通过ArkOS部署/){.md-button}
[通过docker部署](./%20私有化部署/通过docker部署/){.md-button}
[通过docker部署](./%20私有化部署/通过Docker部署/){.md-button}
[通过k8s部署](./%20私有化部署/通过k8s部署/){.md-button}

0 comments on commit 4d88685

Please sign in to comment.