feat: implement auto-setup for Lite edition, enhancing user experience by automating user and tenant creation on first launch
This commit is contained in:
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户信息
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user