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,17 +57,15 @@ const device = (() => {
const upload = () => { const upload = () => {
if (queue.length > 0) { if (queue.length > 0) {
try { const data = JSON.stringify({ "logs": queue })
const data = JSON.stringify({ "logs": queue }) axios.post("https://in.appcenter.ms/logs?api-version=1.0.0", data,{
axios.post("https://in.appcenter.ms/logs?api-version=1.0.0", data,{ headers: {
headers: { "App-Secret": key,
"App-Secret": key, "Install-ID": install
"Install-ID": install }
} }).then(_ => {
}).then(_ => { queue.length = 0
queue.length = 0 }).catch(_ => {})
})
} catch (e) {}
} }
} }

View File

@@ -60,8 +60,12 @@ const exportToCocogoat = async proto => {
date: getDate(finishTimestamp) date: getDate(finishTimestamp)
}) })
}) })
exec("clip").stdin.end(JSON.stringify(out,null,2)) const ts = Date.now()
console.log("导出内容已复制到剪贴板") 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 => { const exportToCsv = async proto => {

View File

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