Discourse Meta
在主题组件中隐藏 API 令牌
支持
RGJ
(Richard - Communiteq)
2022 年9 月 5 日 15:47
2
是的,您确实应该创建一个插件,并定义一个控制器方法来为您获取数据。
然后,从前端代码中调用控制器方法,该方法在服务器端注入承载令牌,第三方无法访问,并调用外部 API。
在话题中显示帖子
相关话题
话题
回复
浏览量
活动
Hiding the API Key
Development
3
644
2020 年6 月 17 日
Is a theme component or plugin best for external API calls?
Development
4
228
2025 年4 月 30 日
Can I expose a route with no authentication?
Development
12
1737
2020 年9 月 14 日
Display a value from an external webservice in the header
Development
3
530
2023 年4 月 2 日
Skip "Authorize application access"
Development
rest-api
5
767
2020 年10 月 21 日