modal.js 635 B

12345678910111213141516171819202122232425262728
  1. import { defineStore } from 'pinia';
  2. const modal = defineStore({
  3. id: 'modal',
  4. state: () => ({
  5. auth: '', // 授权弹框 accountLogin|smsLogin|resetPassword|changeMobile|changePassword|changeUsername
  6. loginType: 'accountLogin',
  7. menu: false, // 快捷菜单弹框
  8. lastTimer: {
  9. // 短信验证码计时器,为了防止刷新请求做了持久化
  10. smsLogin: 0,
  11. changeMobile: 0,
  12. resetPassword: 0,
  13. changePassword: 0,
  14. }
  15. }),
  16. persist: {
  17. enabled: true,
  18. strategies: [
  19. {
  20. key: 'modal-store',
  21. paths: ['lastTimer'],
  22. },
  23. ],
  24. },
  25. });
  26. export default modal;