finished getPersonalRanking()

This commit is contained in:
rchrist 2019-05-08 16:55:43 +02:00
parent 2a16638278
commit a56d2f3c22

View File

@ -290,8 +290,8 @@
this.$store.commit('auth/SET_AUTHENTICATED');
this.$store.commit('auth/SET_USER');
this.email = JSON.parse(localStorage.getItem('userMail'));
this.data[1].userData = this.email;
//this.getPersonalRanking();
this.data[0].userData = this.email;
this.getPersonalRanking();
this.getTeamData();
},
methods: {
@ -300,17 +300,11 @@
return re.test(String(email).toLowerCase());
},
getPersonalRanking() {
let token;
if (localStorage.getItem('userToken')) {
token = JSON.parse(localStorage.getItem('userToken')).token;
} else {
return;
}
this.$axios.get('/api/getRankingPlace', {params: {token}})
let name = this.email;
this.$axios.get('/api/hello', {params: {name}})
.then((response) => {
this.userRanking = response.data;
console.log(response.data);
this.data[2].userData = this.userRanking;
this.data[1].userData = this.userRanking;
}).catch((error) => {
this.handleError(error);
})
@ -335,9 +329,9 @@
this.currentTeamStatus = response.data.teamStatus;
this.teamRanking = response.data.teamRanking;
}
this.data[3].userData = this.teamName;
this.data[2].userData = this.teamName;
this.dropDownSelectedItem = this.teamName;
this.data[4].userData = this.teamRanking;
this.data[3].userData = this.teamRanking;
console.log("getTeam: " + response);
}).catch((error) => {
this.handleError(error);