feat(tenant): enhance tenant information update with description field and add global invitation bell component

Updated the tenant information API to allow editing of both name and description fields, improving user experience in managing tenant details. Introduced a new GlobalInvitationBell component to display pending invitations in the UI, ensuring users can easily access their invitations without navigating away from their current context. Additionally, updated internationalization files to support new description-related messages.

Refs: #1303
This commit is contained in:
wizardchen
2026-05-18 10:59:12 +08:00
committed by lyingbug
parent ce67ba0310
commit b0b05b49c5
11 changed files with 291 additions and 142 deletions
+4 -4
View File
@@ -71,14 +71,14 @@ export async function resetTenantApiKey(
}
/**
* 更新租户信息(目前仅暴露租户名称编辑入口)。
* 后端 `PUT /tenants/:id` 走 GORM 的 `Updates(tenant)`,只会写入请求体里
* 出现的非零字段;这里只发送 `name` 就只会改名字,不会把其它字段清空。
* 更新租户信息(目前暴露名称、描述两个字段的编辑入口)。
* 后端 `PUT /tenants/:id` 用指针字段区分"未传"和"显式空串",未传的列不会
* 被改动;这里也按需选择性传 `name` / `description`,互不影响。
* 权限:owner(与 router.go 中的 g.Owner() 守卫保持一致)。
*/
export async function updateTenant(
tenantId: number,
payload: { name: string },
payload: { name?: string; description?: string },
): Promise<{ success: boolean; data?: TenantInfo; message?: string }> {
try {
const response = await put(`/api/v1/tenants/${tenantId}`, payload)