增加点餐智能推荐
This commit is contained in:
29
store/account.js
Normal file
29
store/account.js
Normal file
@@ -0,0 +1,29 @@
|
||||
// stores/counter.js
|
||||
import { defineStore } from "pinia";
|
||||
import * as shopApi from "@/http/api/shop.js";
|
||||
|
||||
// 分销
|
||||
export const useAccountInfoStore = defineStore("accountInfo", {
|
||||
state: () => {
|
||||
return {
|
||||
shopInfo: {},
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
getShopInfo() {
|
||||
return shopApi.getShopInfo().then((res) => {
|
||||
this.shopInfo = res;
|
||||
return this.shopInfo;
|
||||
});
|
||||
},
|
||||
editShopInfo(data,autoRefresh = true) {
|
||||
return shopApi.editShopInfo(data).then((res) => {
|
||||
if(autoRefresh) {
|
||||
this.getShopInfo()
|
||||
}
|
||||
return res
|
||||
});
|
||||
},
|
||||
},
|
||||
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
||||
});
|
||||
Reference in New Issue
Block a user