25 lines
515 B
JavaScript
25 lines
515 B
JavaScript
![]() |
import { reactive } from 'vue'
|
||
|
import { defineStore } from "pinia";
|
||
|
|
||
|
const useAdminStore = defineStore('admin', () => {
|
||
|
const data = reactive({
|
||
|
name:"",
|
||
|
token:"",
|
||
|
exporeDate:"" //过期日期
|
||
|
})
|
||
|
const save = (name,token,exporeDate) => {
|
||
|
data.name = name
|
||
|
data.token = token
|
||
|
data.exporeDate = exporeDate
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
data,
|
||
|
save
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
persist: true //初九话存储到 localStorage中
|
||
|
})
|
||
|
export { useAdminStore }
|