Skip to content

Commit

Permalink
fix: use localStorage instead of cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Aug 27, 2023
1 parent 72188ee commit e7132c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion stores/useMarksStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@ export const useMarksStore = defineStore('marks', {
this.marks = marks
}
},
persist: true
persist: {
storage: sessionStorage
}
})
6 changes: 4 additions & 2 deletions stores/useUserStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserInfoRes } from 'composables/api'
import type { UserInfoRes } from '@/composables/api'
import dayjs from 'dayjs'

export interface UserState {
Expand Down Expand Up @@ -53,5 +53,7 @@ export const useUserStore = defineStore('user', {
this.expiredAt = dayjs().add(1, 'month').valueOf()
}
},
persist: true
persist: {
storage: sessionStorage
}
})

0 comments on commit e7132c2

Please sign in to comment.