This commit is contained in:
2026-08-08 11:05:45 +08:00
parent 6f709267b7
commit 4835904507
5 changed files with 133 additions and 13 deletions
+3 -2
View File
@@ -281,10 +281,11 @@ describe('platform IAM roles', () => {
establishedDate: '2020-01-01', registeredCapital: 1000, registeredCapitalCurrency: 'CNY',
registeredAddress: '深圳市宝安区', internalRemark: '重点客户',
}
vi.mocked(http.post).mockResolvedValue({ code: '200', message: 'success', data: tenant })
const creation = { tenant, administratorUsername: '13800138000', temporaryPassword: 'Password1234' }
vi.mocked(http.post).mockResolvedValue({ code: '200', message: 'success', data: creation })
vi.mocked(http.put).mockResolvedValue({ code: '200', message: 'success', data: tenant })
await expect(createPlatformTenant(create)).resolves.toEqual(tenant)
await expect(createPlatformTenant(create)).resolves.toEqual(creation)
await expect(updatePlatformTenant('8', create)).resolves.toEqual(tenant)
await expect(changePlatformTenantStatus('8', 'DISABLED')).resolves.toEqual(tenant)
+7 -1
View File
@@ -141,6 +141,12 @@ export interface EnterpriseApprovalResponse {
temporaryPassword: string | null
}
export interface PlatformTenantCreationResponse {
tenant: PlatformTenantResource
administratorUsername: string
temporaryPassword: string
}
export interface ResetPlatformTenantOwnerPasswordRequest {
newPassword: string
forceChangePassword: boolean
@@ -350,7 +356,7 @@ export async function checkPlatformTenantContactPhone(contactPhone: string, excl
}
export function createPlatformTenant(payload: CreatePlatformTenantRequest) {
return postData<PlatformTenantResource>('/platform/v1/iam/tenants', payload)
return postData<PlatformTenantCreationResponse>('/platform/v1/iam/tenants', payload)
}
export function updatePlatformTenant(tenantId: number | string, payload: UpdatePlatformTenantRequest) {