first commit
This commit is contained in:
commit
69b647145f
58 files changed
+15796
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { useLocalStorage } from '@vueuse/core'
|
||||
|
||||
export function useClientId() {
|
||||
const clientId = useLocalStorage('sejong.clientId', '')
|
||||
|
||||
if (import.meta.client && !clientId.value) {
|
||||
clientId.value =
|
||||
typeof crypto !== 'undefined' && crypto.randomUUID
|
||||
? crypto.randomUUID()
|
||||
: `client-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`
|
||||
}
|
||||
|
||||
return { clientId }
|
||||
}
|
||||
Reference in new issue
Block a user