feat:更新朋友圈点赞功能

This commit is contained in:
2025-06-30 19:19:25 +08:00
parent 0969af5ade
commit 0346586548
10 changed files with 69 additions and 22 deletions

View File

@@ -21,7 +21,15 @@ import {
import type { IDialog, IHandleApi, IStatsChart } from 'vue3-common/types'
import { ElMessage } from 'element-plus'
import { getCurrentMonth, getCurrentYear, getStartEndDate } from 'vue3-common/utils/dateUtil'
import { addCommentApi, addMomentApi, deleteMomentApi, queryMomentApi, updateMomentApi } from '@/apis/moment'
import {
addCommentApi,
addLikeApi,
addMomentApi,
deleteLikeApi,
deleteMomentApi,
queryMomentApi,
updateMomentApi
} from '@/apis/moment'
export const useFoodStore = defineStore('food', {
state: () => ({
@@ -193,6 +201,14 @@ export const useFoodStore = defineStore('food', {
await addCommentApi(id, content)
await this.queryMomentList()
},
async addLike(id: number) {
await addLikeApi(id)
await this.queryMomentList()
},
async deleteLike(id: number) {
await deleteLikeApi(id)
await this.queryMomentList()
},
async refreshInfo() {
await this.queryRecipeList()
await this.queryRecordList()