This commit is contained in:
Jay 2018-12-05 21:04:40 +08:00
parent 0f479b1f9b
commit d507cbff55
2 changed files with 11 additions and 8 deletions

View File

@ -58,15 +58,16 @@ export default {
if (typeof id !== 'string') return
this.nowGroup = id
this.page = { cur: 1, total: 1 }
this.getLog(1)
this.getLog()
},
getLog (page = 1) {
getLog (page = -1) {
this.getLogList({
group: this.nowGroup,
page: this.page.cur,
page: page,
max: 20,
cb: list => {
this.list = list
cb: data => {
this.list = data.list
this.page = data.page
}})
}
},

View File

@ -255,13 +255,15 @@ export default {
let opts = {
method: 'get',
url: '/api/line/logs',
params: {}
params: {
order: 'asc'
}
}
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
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) {
errorCatch.call(commit, err)
}