update
This commit is contained in:
parent
0f479b1f9b
commit
d507cbff55
@ -58,15 +58,16 @@ export default {
|
|||||||
if (typeof id !== 'string') return
|
if (typeof id !== 'string') return
|
||||||
this.nowGroup = id
|
this.nowGroup = id
|
||||||
this.page = { cur: 1, total: 1 }
|
this.page = { cur: 1, total: 1 }
|
||||||
this.getLog(1)
|
this.getLog()
|
||||||
},
|
},
|
||||||
getLog (page = 1) {
|
getLog (page = -1) {
|
||||||
this.getLogList({
|
this.getLogList({
|
||||||
group: this.nowGroup,
|
group: this.nowGroup,
|
||||||
page: this.page.cur,
|
page: page,
|
||||||
max: 20,
|
max: 20,
|
||||||
cb: list => {
|
cb: data => {
|
||||||
this.list = list
|
this.list = data.list
|
||||||
|
this.page = data.page
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -255,13 +255,15 @@ export default {
|
|||||||
let opts = {
|
let opts = {
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/api/line/logs',
|
url: '/api/line/logs',
|
||||||
params: {}
|
params: {
|
||||||
|
order: 'asc'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (group.length > 0) opts.params.group = group
|
if (group.length > 0) opts.params.group = group
|
||||||
if (page > 1) opts.params.p = page
|
if (page > 1 || page < 0) opts.params.p = page
|
||||||
if (max > 0) opts.params.max = max
|
if (max > 0) opts.params.max = max
|
||||||
let res = await client(opts)
|
let res = await client(opts)
|
||||||
if (cb !== null && typeof cb === 'function') cb(res.data.list)
|
if (cb !== null && typeof cb === 'function') cb(res.data)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
errorCatch.call(commit, err)
|
errorCatch.call(commit, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user