|
|
@@ -1,6 +1,7 @@
|
|
|
import { io } from "socket.io-client"
|
|
|
import axios from "axios"
|
|
|
import { setTimeout } from "timers/promises"
|
|
|
+import chalk from "chalk"
|
|
|
const axiosInstance = axios.create({
|
|
|
baseURL: "http://47.98.225.28/api",
|
|
|
headers: {
|
|
|
@@ -33,21 +34,23 @@ for (let device of devices) {
|
|
|
}
|
|
|
)
|
|
|
if (!out.includes("versionName=28.0")) {
|
|
|
- console.error(device.id, device.name)
|
|
|
- axiosInstance
|
|
|
- .post(
|
|
|
- `/device/${device.id}/sendMessage`,
|
|
|
- {
|
|
|
- action: "installApk",
|
|
|
- data: {
|
|
|
- apkUrl: "https://nebuai.oss-cn-hangzhou.aliyuncs.com/application/20241011/t9ocwlqc.apk"
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- timeout: 2000
|
|
|
- }
|
|
|
- )
|
|
|
- .catch(e => console.log(e.message))
|
|
|
+ console.log(chalk.blue(device.id, device.name, "update"))
|
|
|
+ // axiosInstance
|
|
|
+ // .post(
|
|
|
+ // `/device/${device.id}/sendMessage`,
|
|
|
+ // {
|
|
|
+ // action: "installApk",
|
|
|
+ // data: {
|
|
|
+ // apkUrl: "https://nebuai.oss-cn-hangzhou.aliyuncs.com/application/20241011/t9ocwlqc.apk"
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // timeout: 2000
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+ // .catch(e => console.log(e.message))
|
|
|
+ } else {
|
|
|
+ console.log(device.id, device.name, "OK")
|
|
|
}
|
|
|
} catch (e) {
|
|
|
console.log(device.id, device.name, e.message)
|