fix crash when appcenter error

This commit is contained in:
HolographicHat
2022-03-25 19:22:34 +08:00
parent 7b18bcfbd3
commit bdf9561dfa
3 changed files with 17 additions and 15 deletions

View File

@@ -57,7 +57,6 @@ const device = (() => {
const upload = () => {
if (queue.length > 0) {
try {
const data = JSON.stringify({ "logs": queue })
axios.post("https://in.appcenter.ms/logs?api-version=1.0.0", data,{
headers: {
@@ -66,8 +65,7 @@ const upload = () => {
}
}).then(_ => {
queue.length = 0
})
} catch (e) {}
}).catch(_ => {})
}
}

View File

@@ -60,8 +60,12 @@ const exportToCocogoat = async proto => {
date: getDate(finishTimestamp)
})
})
exec("clip").stdin.end(JSON.stringify(out,null,2))
console.log("导出内容已复制到剪贴板")
const ts = Date.now()
const json = JSON.stringify(out,null,2)
exec("clip").stdin.end(json)
const fp = `./export-${ts}-cocogoat.json`
fs.writeFileSync(fp, json)
console.log(`导出内容已复制到剪贴板,若拷贝失败请手动复制 export-${ts}-cocogoat.json 文件内容`)
}
const exportToCsv = async proto => {

View File

@@ -1,6 +1,6 @@
const version = {
code: 2,
name: "1.0.1"
code: 3,
name: "1.2"
}
module.exports = { version }