| 1234567891011121314151617181920212223242526 |
- import {defineStore} from 'pinia'
- import ImmunityApi from '@/api/ImmunityApi'
- import {useUserStore} from '@/store/userStore'
- import type AjaxResult from '@/mode/AjaxResult'
- import type Immunity from '@/mode/Immunity'
- /**
- * @description 免打扰库
- */
- export const useImmunityStore = defineStore({
- id: 'immunity_store',
- state: () => ({
- immunityList: new Array<string>()
- }),
- actions: {
- loadData() {
- const userId = useUserStore().getUser()?.id
- if (userId) {
- ImmunityApi.list(userId).then((res:AjaxResult<Immunity[]>) => {
- //console.log('ImmunityApi',res)
- this.immunityList = res.data.map((item) => item.chatId)
- })
- }
- }
- }
- })
|