# 用主题组件还是插件进行外部API调用更合适？

**URL:** https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145
**Category:** Development
**Created:** [2025年四月30日 12:38 UTC](https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145 "2025-04-30T12:38:28Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![noahl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/noahl/32/552343_2.png) [@noahl](https://meta.discourse.org/u/noahl)
#### Post date: [2025年四月30日 12:38 UTC](https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145/1 "2025-04-30T12:38:28Z")

</div>

我们有一个认证计划，并希望在用户确认其认证 ID 后允许他们加入认证组。

目前的想法：

- 在插件插槽中有一个按钮
- 点击后，打开一个模态框让他们输入认证 ID
- 将 ID 发送到 API，并根据结果显示消息
- 如果用户已验证，则将其添加到组中

我想了解这更适合作为插件还是主题组件，因为它涉及 API 调用。

---

_[View the full topic](https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145)._
