Refactor user store and async data handling
This commit is contained in:
@ -71,8 +71,7 @@
|
|||||||
import type { PageResultMemberPointRecordRespVO } from '~/api/personal-center/types'
|
import type { PageResultMemberPointRecordRespVO } from '~/api/personal-center/types'
|
||||||
import useUserStore from '~/stores/user'
|
import useUserStore from '~/stores/user'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
const userStore = useUserStore()
|
const user = useUserInfo()
|
||||||
const user = useUserInfo();
|
|
||||||
|
|
||||||
const query = reactive({
|
const query = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@ -116,12 +115,16 @@
|
|||||||
getUserPointPageList()
|
getUserPointPageList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const {data: result, refresh: getUserPointPageList } = await useAsyncData('getUserPointPage', async () => {
|
const { data: result, refresh: getUserPointPageList } = await useAsyncData(
|
||||||
|
'getUserPointPage',
|
||||||
|
async () => {
|
||||||
const res = await getUserPointPage(query)
|
const res = await getUserPointPage(query)
|
||||||
return res.data
|
return res.data
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
immediate: true, // 立即请求
|
immediate: true, // 立即请求
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
||||||
// const getUserPointPageList = async () => {
|
// const getUserPointPageList = async () => {
|
||||||
// const res = await getUserPointPage(query)
|
// const res = await getUserPointPage(query)
|
||||||
|
|||||||
Reference in New Issue
Block a user