浏览代码

Fix:Fix the bug of incorrectly gets the APIToken. (#5597)

### What problem does this PR solve?

Fix the issue where, when getting a user's APIToken, if the user is part
of another user's team, it incorrectly gets the Team owner's APIToken
instead.


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.17.1
kunyi-yang 8 个月前
父节点
当前提交
555c70672e
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      api/apps/system_app.py

+ 2
- 2
api/apps/system_app.py 查看文件

@@ -201,7 +201,7 @@ def new_token():
if not tenants:
return get_data_error_result(message="Tenant not found!")

tenant_id = tenants[0].tenant_id
tenant_id = [tenant for tenant in tenants if tenant.role == 'owner'][0].tenant_id
obj = {
"tenant_id": tenant_id,
"token": generate_confirmation_token(tenant_id),
@@ -256,7 +256,7 @@ def token_list():
if not tenants:
return get_data_error_result(message="Tenant not found!")

tenant_id = tenants[0].tenant_id
tenant_id = [tenant for tenant in tenants if tenant.role == 'owner'][0].tenant_id
objs = APITokenService.query(tenant_id=tenant_id)
objs = [o.to_dict() for o in objs]
for o in objs:

正在加载...
取消
保存