mall-uniapp/sheep/store/modal.js

30 lines
697 B
JavaScript
Raw Normal View History

2022-11-22 07:45:36 +00:00
import { defineStore } from 'pinia';
const modal = defineStore({
id: 'modal',
state: () => ({
auth: '', // 授权弹框 accountLogin|smsLogin|resetPassword|changeMobile|changePassword|changeUsername
2022-11-22 07:45:36 +00:00
share: false, // 分享弹框
menu: false, // 快捷菜单弹框
advHistory: [], // 广告弹框记录
lastTimer: {
// 短信验证码计时器,为了防止刷新请求做了持久化
smsLogin: 0,
changeMobile: 0,
resetPassword: 0,
2023-12-17 10:57:08 +00:00
changePassword: 0,
2022-11-22 07:45:36 +00:00
}
}),
persist: {
2023-12-17 10:57:08 +00:00
enabled: true,
2022-11-22 07:45:36 +00:00
strategies: [
{
key: 'modal-store',
paths: ['lastTimer', 'advHistory'],
},
],
},
});
export default modal;