ak-interactive-captcha
ak-interactive-captcha lives in apps/ak-mobile/uni_modules/ak-interactive-captcha and supports the uni-app x Android, iOS, and HarmonyOS Core targets. It renders a server challenge and emits an answer; it never owns networking, persists a token, or sends SMS.
Props and events
Changing the challenge, closing, refreshing, or reaching the 300-second expiry resets old points and angles. Tapping the backdrop does not dismiss the modal.
Interaction types
Click and drag coordinates are normalized to the server image's original dimensions. Never submit raw display coordinates.
Repository integration
App bootstrap configures captchaRuntime with the shared AkHttpClient. A feature creates a business intent and owns the returned challenge:
On confirm(response), call repository.submission(challenge, response) to build { id, token, response }, then immediately call the original SMS endpoint. Close the modal after success and start the OTP countdown from the server's retry_after_seconds. Keep the modal on recoverable errors; refresh when the proof is expired, invalid, or exhausted.
Every send and resend needs a fresh challenge. Email OTP never opens this component. See Mobile authentication API for the HTTP contract.
Reuse boundaries
- Reuse the existing
captchaRuntimeand models; do not add networking or business scenes to the component. - Treat
tokenas opaque transit data: never parse, cache, or log it. AkI18nsupplies visible strings. The component includes safe-area padding, 44px controls, error announcements, and no decorative animation.- Supported scope is uni-app x Android/iOS/HarmonyOS Core, not classic uni-app, H5, or mini programs.