Files
yshop-pro-uniapp/store/modules/useGlobalRequestStore.js
2024-02-22 18:37:23 +08:00

33 lines
798 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @name: globalRequestStore
* @author: kahu4
* @date: 2024-02-21 17:32
* @description公共方法
* @update: 2024-02-21 17:32
* */
import { defineStore } from "pinia";
import store from "@/store";
import { shareToAddIntegral } from "@/api/account/integral";
export const useGlobalRequestStore = defineStore('globalRequestStore', {
state: () => ({}),
getters: {},
actions: {
/**
* 分享商品获取积分
* @return {Promise<boolean>}
*/
async doShareToAddIntegral() {
try {
await shareToAddIntegral()
return true
} catch (e) {
return false
}
}
},
});
export const useGlobalRequestStoreWithOut = () => useGlobalRequestStore(store);