diff --git a/src/components/ControlPanel/lineLog/index.vue b/src/components/ControlPanel/lineLog/index.vue index 9a9634c..a4f095b 100644 --- a/src/components/ControlPanel/lineLog/index.vue +++ b/src/components/ControlPanel/lineLog/index.vue @@ -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 }}) } }, diff --git a/src/store/actions.js b/src/store/actions.js index 753f26a..74ef0de 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -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) }