(pluginName: string)
| 138 | * 插件仅可以通过这种方式进行网络请求发送 |
| 139 | */ |
| 140 | export function createPluginRequest(pluginName: string) { |
| 141 | return { |
| 142 | get(actionName: string, config?: RequestConfig) { |
| 143 | return request.get( |
| 144 | `/api/plugin:${pluginName}/${actionName.replace(/\./g, '/')}`, |
| 145 | purgeRequestConfig(config) |
| 146 | ); |
| 147 | }, |
| 148 | post(actionName: string, data?: any, config?: RequestConfig) { |
| 149 | return request.post( |
| 150 | `/api/plugin:${pluginName}/${actionName.replace(/\./g, '/')}`, |
| 151 | data, |
| 152 | purgeRequestConfig(config) |
| 153 | ); |
| 154 | }, |
| 155 | }; |
| 156 | } |
| 157 | |
| 158 | /** |
| 159 | * 发起一个网络请求 |
no outgoing calls
no test coverage detected