diff --git a/src/oauth/oauth.ts b/src/oauth/oauth.ts index c3e05d5..68d5816 100644 --- a/src/oauth/oauth.ts +++ b/src/oauth/oauth.ts @@ -58,7 +58,7 @@ export type UserExpand = { } & StoreSetOpts; type StoreSetOpts = { - loginType?: 'default' | 'plugin' | 'month' | 'season' | 'year' | 'week'; // 登陆类型 'default' | 'plugin' | 'month' | 'season' | 'year' + loginType?: 'default' | 'plugin' | 'month' | 'season' | 'year' | 'week' | 'day'; // 登陆类型 'default' | 'plugin' | 'month' | 'season' | 'year' expire?: number; // 过期时间,单位为秒 hasRefreshToken?: boolean; [key: string]: any; @@ -137,6 +137,9 @@ export class RedisTokenStore implements Store { let expire = opts?.expire; if (!expire) { switch (opts.loginType) { + case 'day': + expire = 24 * 60 * 60; + break; case 'week': expire = 7 * 24 * 60 * 60; break; @@ -147,7 +150,7 @@ export class RedisTokenStore implements Store { expire = 90 * 24 * 60 * 60; break; default: - expire = 25 * 60 * 60; // 默认过期时间为25小时 + expire = 7 * 24 * 60 * 60; // 默认过期时间为7天 } } else { expire = Math.min(expire, 60 * 60 * 24 * 30, 60 * 60 * 24 * 90); // 默认的过期时间最大为90天