mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
chore: 用esbuild代替vite来打包main
This commit is contained in:
parent
b4590c3c34
commit
c4219afd3d
152 changed files with 669 additions and 747 deletions
19
src/renderer/utils/cookie.ts
Normal file
19
src/renderer/utils/cookie.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import Cookies from 'js-cookie'
|
||||
|
||||
export function setCookies(string: string) {
|
||||
const cookies = string.replace(/;.*?HTTPOnly.*?;/g, ';;').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