mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
🎨 常用的给封装了一下
This commit is contained in:
@@ -32,6 +32,36 @@ export const useUserStore = defineStore(
|
||||
return cookie.value[key] || "";
|
||||
}
|
||||
|
||||
function getCookieGroup1 (): TGApp.BBS.Constant.CookieGroup1 {
|
||||
return {
|
||||
login_ticket: getCookieItem("login_ticket"),
|
||||
login_uid: getCookieItem("login_uid"),
|
||||
};
|
||||
}
|
||||
|
||||
function getCookieGroup2 (): TGApp.BBS.Constant.CookieGroup2 {
|
||||
return {
|
||||
account_id: getCookieItem("account_id"),
|
||||
cookie_token: getCookieItem("cookie_token"),
|
||||
};
|
||||
}
|
||||
|
||||
function getCookieGroup3 (): TGApp.BBS.Constant.CookieGroup3 {
|
||||
return {
|
||||
ltoken: getCookieItem("ltoken"),
|
||||
ltuid: getCookieItem("ltuid"),
|
||||
};
|
||||
}
|
||||
|
||||
function getCookieGroup4 (): TGApp.BBS.Constant.CookieGroup4 {
|
||||
return {
|
||||
account_id: getCookieItem("account_id"),
|
||||
cookie_token: getCookieItem("cookie_token"),
|
||||
ltoken: getCookieItem("ltoken"),
|
||||
ltuid: getCookieItem("ltuid"),
|
||||
};
|
||||
}
|
||||
|
||||
function initCookie (ck: Record<string, string>): void {
|
||||
if (cookie.value !== ck) {
|
||||
cookie.value = ck;
|
||||
@@ -43,6 +73,10 @@ export const useUserStore = defineStore(
|
||||
getBriefInfo,
|
||||
setBriefInfo,
|
||||
getCookieItem,
|
||||
getCookieGroup1,
|
||||
getCookieGroup2,
|
||||
getCookieGroup3,
|
||||
getCookieGroup4,
|
||||
initCookie,
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user