| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- /**
- * 用户状态管理
- */
- import {
- defineStore
- } from 'pinia'
- import {
- getCardInfo,
- getCardQrcode,
- getCompanyInfo
- } from '@/api/card.js'
- export const useUserStore = defineStore('user', {
- state: () => ({
- userLoc: null
- }),
- actions: {
- // 获取用户卡片信息
- queryCardInfo(userId = null) {
- return new Promise(async(resolve, reject) => {
- let res = await getCardInfo({
- userId
- })
- console.log(res, "aaaaaaaaaaaaaaaaa");
- resolve(res.data)
- })
- },
- queryCompanyInfo(userId = null) {
- return new Promise(async(resolve, reject) => {
- let res = await getCompanyInfo({
- userId
- })
- console.log(res, "bbbbbbbbbbbbbbbbbb");
- resolve(res.data)
- })
- },
- }
- })
|