Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: home page article null #303

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cmd/gopcomm/yap/home_yap.html
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,11 @@ <h1 v-else class="text-4xl"> Have no data!</h1>
/*======= load more data after reaching bottom =======*/
// const videoGet = ref(false);
// const stemGet = ref(false);
console.log("articles", articles)
const videoList = ref([]);
const stemList = ref([]);
const articleList = ref({
article: articles,
article: articles || [],
video: [],
stem: [],
});
Expand Down Expand Up @@ -651,7 +652,7 @@ <h1 v-else class="text-4xl"> Have no data!</h1>
.then(todos => {
if (todos.code === 200) {
console.log("todos.next", todos.next)
if(todos.items == null){
if(todos.items === null){
todos.items = []
}
articleList.value[tabName].push(...todos.items);
Expand Down
8 changes: 4 additions & 4 deletions cmd/gopcomm/yap/user_yap.html
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,11 @@ <h1 class="text-4xl"> Have no data!</h1>
.then(todos => {
if (todos.code === 200) {
if (format === "video") {
videoList.value = todos.items
videoList.value = todos.items || []
videoGet.value = true
totalVideoPage.value = Math.ceil(todos.total/pageSize.value);
} else {
imageList.value = todos.items
imageList.value = todos.items || []
imageGet.value = true
totalImagePage.value = Math.ceil(todos.total/pageSize.value);
}
Expand All @@ -769,7 +769,7 @@ <h1 class="text-4xl"> Have no data!</h1>
.then(todos => {
if (todos.code === 200) {
userGet.value = true
userList.value = todos.items
userList.value = todos.items || []
totalUserPage.value = Math.ceil(todos.total/pageSize.value);
console.log("userList", userList.value)
console.log("totalUserPage", totalUserPage.value)
Expand Down Expand Up @@ -851,7 +851,7 @@ <h1 class="text-4xl"> Have no data!</h1>
})
.then(todos => {
if (todos.code === 200) {
articleList.value = todos.items;
articleList.value = todos.items || [];
totalArticlePage.value = Math.ceil(todos.total/pageSize.value);
addShareCount();
}
Expand Down
Loading