修复增加不存在的鸡精时进程死掉的bug

master
宇天 2020-08-25 11:05:08 +08:00
parent 6493ee516e
commit 45ab088e89
2 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "io.yutent.gaystat",
"version": "1.6.0",
"version": "1.7.0",
"description": "搞基数据",
"main": "src/main.js",
"scripts": {

View File

@ -23,8 +23,11 @@ const WIN = remote.getCurrentWindow()
const $doc = Anot(document)
function getJsonp(str) {
if (~str.indexOf('jsonpgz')) {
return new Function(`function jsonpgz(d){return d}; return ${str}`)()
}
return false
}
function getTableData(str) {
var match = str.match(/<tbody[^]*?>.*?<\/tbody>/)
@ -93,6 +96,7 @@ Anot({
'net',
`https://fundgz.1234567.com.cn/js/${id}.js`
)
return getJsonp(res)
},
@ -117,8 +121,9 @@ Anot({
}
Anot.nextTick(_ => {
var info = this.getTodayStat(id)
var last = this.getLastMonth(id)
var last
if (info) {
last = this.getLastMonth(id)
var tmp = {
code: info.fundcode,
name: info.name,
@ -130,6 +135,8 @@ Anot({
this.list.unshift(tmp)
this.$dict[tmp.code] = this.list[0]
Anot.ls('watch_list', this.list.$model)
} else {
layer.toast('鸡精不存在', 'error')
}
})
})