修改我邀请列表分页报错

This commit is contained in:
yuyongdong 2024-04-19 20:42:02 +08:00
parent ddc04eed65
commit 89b1af7926

View File

@ -75,29 +75,34 @@ export default {
// } // }
// ], // ],
invitationList: [], invitationList: [],
token: ''
}; };
}, },
computed: { computed: {
// //
logCurrentPageItems() { logCurrentPageItems() {
if(this.invitationList.length == 0){ if(this.invitationList !== undefined && this.invitationList.length > 0){
let start = (this.logCurrentPage - 1) * this.logPageSize;
let end = start + this.logPageSize;
return this.invitationList.slice(start, end)
} else {
return this.invitationList return this.invitationList
} }
let start = (this.logCurrentPage - 1) * this.logPageSize;
let end = start + this.logPageSize;
return this.invitationList.slice(start, end)
}, },
}, },
mounted() { mounted() {
this.getMyInvitationData(); this.token = getToken();
if(this.token) {
this.getMyInvitationData();
}
}, },
methods: { methods: {
// //
async getMyInvitationData() { async getMyInvitationData() {
let token = getToken();
let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/invite_list", { let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/invite_list", {
params: "", params: "",
headers: { Authorization: `Bearer ${token}` } headers: { Authorization: `Bearer ${this.token}` }
}); });
// ToDo // ToDo
this.invitationList = res.data.data this.invitationList = res.data.data