GET
取得当前运行 Eagle App 的详细信息,通常我们可以透过这个方式判断用户设备是否能够运行某些功能。
范例代码:
var requestOptions = {
method: 'GET',
redirect: 'follow'
};
fetch("http://localhost:41595/api/application/info", requestOptions)
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.log('error', error));
返回结果:
{
"status": "success",
"data": {
"version": "1.11.0",
"prereleaseVersion": null,
"buildVersion": "20200612",
"execPath": "/Users/augus/Projects/Eagle App/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/MacOS/Electron Helper (Renderer)",
"platform": "darwin"
}
}