fix:uigf文件下载失败时跳过

This commit is contained in:
Rrrrrrray 2023-11-03 20:57:26 +08:00
parent c503f353c7
commit 0fa4300e3e
1 changed files with 8 additions and 4 deletions

View File

@ -19,7 +19,7 @@ export default class ExportLog extends base {
this.path = this.e.isSr ? `./data/srJson/${this.e.user_id}/` : `./data/gachaJson/${this.e.user_id}/`
this.game = this.e.game || this.e.isSr ? 'sr' : 'gs'
this.game = this.e.game
this.pool = (game = 'gs') => {
let pool = {
@ -156,7 +156,12 @@ export default class ExportLog extends base {
}
getAllList() {
let uigf = JSON.parse(fs.readFileSync('./temp/uigf/genshin.json', 'utf8'))
let uigf = './temp/uigf/genshin.json'
try {
uigf = JSON.parse(fs.readFileSync(uigf, 'utf8'))
} catch (error) {
uigf = false
}
let res = {
list: []
}
@ -171,8 +176,7 @@ export default class ExportLog extends base {
}
res[v.type] = json
for (let v of json) {
// item_id必要字段
if (!v.item_id) {
if (!v.item_id && uigf) {
v.item_id = String(uigf[v.name])
}
if (!this.e.isSr) {