修改我邀请列表分页报错

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: [],
token: ''
};
},
computed: {
//
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
}
let start = (this.logCurrentPage - 1) * this.logPageSize;
let end = start + this.logPageSize;
return this.invitationList.slice(start, end)
},
},
mounted() {
this.getMyInvitationData();
this.token = getToken();
if(this.token) {
this.getMyInvitationData();
}
},
methods: {
//
async getMyInvitationData() {
let token = getToken();
let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/invite_list", {
params: "",
headers: { Authorization: `Bearer ${token}` }
headers: { Authorization: `Bearer ${this.token}` }
});
// ToDo
this.invitationList = res.data.data