# add localStorage
This commit is contained in:
parent
14919161eb
commit
bf5959e40d
|
@ -5,6 +5,7 @@ const counter = {
|
|||
mutations: {
|
||||
CHANGE_DEVICE_ID: (state, deviceID) => {
|
||||
state.deviceID = deviceID
|
||||
localStorage.deviceID = deviceID
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
@ -14,4 +15,12 @@ const counter = {
|
|||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (localStorage.deviceID) {
|
||||
counter.state.deviceID = localStorage.deviceID
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
export default counter
|
||||
|
|
Loading…
Reference in New Issue