purchase-let/unpackage/dist/dev/mp-weixin/store/user.js

13 lines
515 B
JavaScript
Raw Normal View History

2024-04-25 18:02:30 +08:00
"use strict";
const common_vendor = require("../common/vendor.js");
const useUserStore = common_vendor.defineStore("user", () => {
const userInfo = common_vendor.ref(common_vendor.index.getStorageSync("userInfo") || {});
const token = common_vendor.ref(common_vendor.index.getStorageSync("token") || "");
const setToken = (data) => {
token.value = data;
common_vendor.index.setStorageSync("token", data);
};
return { userInfo, setToken, token, setToken };
});
exports.useUserStore = useUserStore;