Telegram 登录授权 Vue 组件,支持 H5 和 uni-app App 环境。当前版本 1.0.1,通过 iframe 或跳转系统浏览器实现 Telegram Login Widget,需配合静态授权页部署。与官方 Telegram Login Widget 相比,提供更便捷的 Vue 集成、自动检测运行时环境、支持自定义样式 slot、以及针对 uni-app 的深链回调机制,并附带辅助函数解析授权结果。
npm install tg-authNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Registers the TgAuth component globally in a Vue 3 app, then use in template with required props.
Implement URL parsing in the App entry to extract the 'arg' parameter from the incoming deep link.
Run `npx tg-auth-copy-static --target <path>` and ensure the domain in BotFather matches the deployed origin.
Explicitly convert the bot ID to a string: :bot-id="String(botId)".
Upgrade to Vue 3 or use an alternative Telegram auth solution.
Ensure both props are provided: <TgAuth :tg-auth-domain="'https://example.com'" :bot-id="'123456789'" />
Run `npx tg-auth-copy-static --target public/static/html` and verify the file exists at the expected URL.