mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 05:38:04 +00:00
refactor: version 2.0 (React)
This commit is contained in:
parent
7dad7d810a
commit
950f72d4e8
356 changed files with 7901 additions and 29547 deletions
19
packages/renderer/src/utils/cookie.ts
Normal file
19
packages/renderer/src/utils/cookie.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import Cookies from 'js-cookie'
|
||||
|
||||
export function setCookies(string: string) {
|
||||
const cookies = string.replace('HTTPOnly', '').split(';;')
|
||||
cookies.map(cookie => {
|
||||
const cookieKeyValue = cookie.split(';')[0].split('=')
|
||||
const [key, value] = cookieKeyValue
|
||||
// store.account.cookies[key] = value
|
||||
Cookies.set(key, value, { expires: 3650 })
|
||||
})
|
||||
}
|
||||
|
||||
export function getCookie(key: string) {
|
||||
return Cookies.get(key)
|
||||
}
|
||||
|
||||
export function removeCookie(key: string) {
|
||||
Cookies.remove(key)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue