From a52a3e269ee5d632032b5ade7b48bd017d71784b Mon Sep 17 00:00:00 2001 From: zema1 Date: Tue, 17 Dec 2019 11:51:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20ac=20time=20=E8=B6=85?= =?UTF-8?q?=E5=87=BA=2024=20=E5=B0=8F=E6=97=B6=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/contest.js | 7 ++++++- src/utils/time.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/store/modules/contest.js b/src/store/modules/contest.js index f35a9101d..76c47e3b3 100644 --- a/src/store/modules/contest.js +++ b/src/store/modules/contest.js @@ -153,7 +153,12 @@ const actions = { return new Promise((resolve, reject) => { api.getContestProblemList(rootState.route.params.contestID).then(res => { res.data.data.sort((a, b) => { - return a._id > b._id + if (a._id === b._id) { + return 0 + } else if (a._id > b._id) { + return 1 + } + return -1 }) commit(types.CHANGE_CONTEST_PROBLEMS, {contestProblems: res.data.data}) resolve(res) diff --git a/src/utils/time.js b/src/utils/time.js index 4dc8a5708..1ecd0a255 100644 --- a/src/utils/time.js +++ b/src/utils/time.js @@ -18,7 +18,7 @@ function duration (startTime, endTime) { function secondFormat (seconds) { let m = moment.duration(seconds, 'seconds') - return m.hours() + ':' + m.minutes() + ':' + m.seconds() + return Math.floor(m.asHours()) + ':' + m.minutes() + ':' + m.seconds() } export default {