商城列表需要优化
This commit is contained in:
16
composables/useAuthUser.js
Normal file
16
composables/useAuthUser.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
/**
|
||||
* 统一提供响应式的用户信息和相关操作
|
||||
*/
|
||||
export const useAuthUser = () => {
|
||||
const userStore = useUserStore()
|
||||
|
||||
// 响应式状态(state & getters)
|
||||
const { userInfo } = storeToRefs(userStore)
|
||||
|
||||
return {
|
||||
userInfo
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user