Files
archived-MoviePilot-Plugins/docs/faq/07-call-api-from-plugin.md
2026-04-20 21:43:30 +08:00

24 lines
750 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 如何在插件中调用API接口
返回 [README](../../README.md) | [FAQ 索引](../FAQ.md)
**(仅支持 `v1.8.4+` 版本)**
- 在插件的数据页面支持`GET/POST`API接口调用可调用插件自身、主程序或其它插件的API。
-`get_page`中定义好元素的事件以及相应的API参数具体可参考插件`豆瓣想看`
```json
{
"component": "VDialogCloseBtn", // 触发事件的元素
"events": {
"click": { // 点击事件
"api": "plugin/DoubanSync/delete_history", // API的相对路径
"method": "get", // GET/POST
"params": {
// API上送参数
"doubanid": ""
}
}
}
}
```
- 每次API调用完成后均会自动刷新一次插件数据页。