feat: implement auto-setup for Lite edition, enhancing user experience by automating user and tenant creation on first launch

This commit is contained in:
wizardchen
2026-04-11 12:47:17 +08:00
committed by lyingbug
parent 52bdfd388a
commit 92bf52721c
8 changed files with 221 additions and 56 deletions
+15
View File
@@ -190,6 +190,21 @@ export async function register(data: RegisterRequest): Promise<RegisterResponse>
}
}
/**
* Lite 版自动初始化(创建默认用户/租户 + 签发令牌)
*/
export async function autoSetup(): Promise<LoginResponse> {
try {
const response = await post('/api/v1/auth/auto-setup', {})
return response as unknown as LoginResponse
} catch (error: any) {
return {
success: false,
message: error.message || 'Auto-setup unavailable'
}
}
}
/**
* 获取当前用户信息
*/