Browse Source

排名清空数据

aaa 3 years ago
parent
commit
48b50d5030
1 changed files with 3 additions and 4 deletions
  1. 3 4
      src/views/home/person/rank.vue

+ 3 - 4
src/views/home/person/rank.vue

@@ -147,7 +147,9 @@ export default {
       this.$_http
       this.$_http
         .get(this.$_API.JTXT_GET_LEADERBOARD, { params })
         .get(this.$_API.JTXT_GET_LEADERBOARD, { params })
         .then(res => {
         .then(res => {
-          console.log(res.data);
+          // 历史数据先清空
+          this.rankListTopThree = [];
+          this.rankListOthers = [];
           if (res.data && res.data.users) {
           if (res.data && res.data.users) {
             res.data.users.forEach((item, index) => {
             res.data.users.forEach((item, index) => {
               if (index < 3) {
               if (index < 3) {
@@ -156,9 +158,6 @@ export default {
                 this.rankListOthers.push(item);
                 this.rankListOthers.push(item);
               }
               }
             });
             });
-          } else {
-            this.rankListTopThree = [];
-            this.rankListOthers = [];
           }
           }
           this.finished = true;
           this.finished = true;
           this.loading = false;
           this.loading = false;