diff --git a/app/.vitepress/src/shared/utils.ts b/app/.vitepress/src/shared/utils.ts index 51955768f6df30149b52a9aae81e8e8fc5583bd5..0ec2fba3becf1713932a6a6537a16ee069406b22 100644 --- a/app/.vitepress/src/shared/utils.ts +++ b/app/.vitepress/src/shared/utils.ts @@ -16,8 +16,13 @@ export function getCustomCookie(key: string) { * @param value cookie的值 * @param day cookie的过期时间 默认1天 */ -export function setCustomCookie(key: string, value: string, day = 1) { - Cookies.set(key, value, { expires: day, path: '/' }); +export function setCustomCookie( + key: string, + value: string, + day = 180, + domain: string = '.openlookeng.io' +) { + Cookies.set(key, value, { expires: day, path: '/', domain }); } /** @@ -56,7 +61,6 @@ export function isBoolean(val: unknown): val is boolean { return typeof val === 'boolean'; } - /** * 获取指定时区偏移量的年份 * @param {number} offset - 时区偏移量(单位:小时)。例如,UTC+8 时区,传入 8。 @@ -71,4 +75,4 @@ export const getYearByOffset = () => { utcTime.setHours(utcTime.getHours() + 8); return utcTime.getFullYear(); -} \ No newline at end of file +};