modal.js 461 B

1234567891011121314151617181920212223
  1. import { defineStore } from 'pinia';
  2. export const modalStore = defineStore({
  3. id: 'modal',
  4. state: () => ({
  5. lastTimer: {
  6. // 短信验证码计时器,为了防止刷新请求做了持久化
  7. smsLogin: 0,
  8. changeMobile: 0,
  9. resetPassword: 0,
  10. changePassword: 0,
  11. }
  12. }),
  13. persist: {
  14. enabled: true,
  15. strategies: [
  16. {
  17. key: 'modal-store',
  18. paths: ['lastTimer', 'advHistory'],
  19. },
  20. ],
  21. },
  22. });