41 lines
975 B
JavaScript
41 lines
975 B
JavaScript
|
import { defineStore } from 'pinia'
|
|||
|
import { ref } from 'vue'
|
|||
|
|
|||
|
const useModalStore = defineStore(
|
|||
|
'modal',
|
|||
|
() => {
|
|||
|
// 授权弹窗 accountLogin,smsLogin,resetPassword,changeMobile,changePassword,changeUsername
|
|||
|
const auth = ref('')
|
|||
|
const share = ref(false)
|
|||
|
const menu = ref(false)
|
|||
|
const advHistory = ref([])
|
|||
|
const lastTimer = ref({
|
|||
|
smsLogin: 0,
|
|||
|
changeMobile: 0,
|
|||
|
resetPassword: 0,
|
|||
|
changePassword: 0,
|
|||
|
})
|
|||
|
|
|||
|
return {
|
|||
|
auth,
|
|||
|
share,
|
|||
|
menu,
|
|||
|
advHistory,
|
|||
|
lastTimer,
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
persist: {
|
|||
|
enabled: true,
|
|||
|
strategies: [
|
|||
|
{
|
|||
|
key: 'modal-store',
|
|||
|
paths: ['lastTimer', 'advHistory'],
|
|||
|
},
|
|||
|
],
|
|||
|
},
|
|||
|
}
|
|||
|
)
|
|||
|
|
|||
|
export default useModalStore
|