From 5e361422c6ef61d662461aeccac8df6bb6c187b2 Mon Sep 17 00:00:00 2001 From: landaiqing <3517283258@qq.com> Date: Sun, 8 Sep 2024 15:47:02 +0800 Subject: [PATCH] :sparkles: update cache expired time --- src/api/captcha/index.ts | 8 ++++++++ src/api/oauth/gitee.ts | 2 +- src/api/oauth/github.ts | 2 +- src/api/oauth/index.ts | 2 +- src/api/oauth/qq.ts | 2 +- src/api/oauth/wechat.ts | 1 + 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/api/captcha/index.ts b/src/api/captcha/index.ts index 18377e8..9b9603d 100644 --- a/src/api/captcha/index.ts +++ b/src/api/captcha/index.ts @@ -1,5 +1,8 @@ import {service} from "@/utils/alova/service.ts"; +/** + * 获取验证码图片数据 + */ export const getRotatedCaptchaData = () => { return service.Get('/api/captcha/rotate/get', { meta: { @@ -8,6 +11,11 @@ export const getRotatedCaptchaData = () => { }); }; +/** + * 验证验证码 + * @param angle + * @param key + */ export const checkRotatedCaptcha = (angle: any, key: any) => { return service.Post('/api/captcha/rotate/check', { angle: angle, diff --git a/src/api/oauth/gitee.ts b/src/api/oauth/gitee.ts index 1f9025b..2f8034f 100644 --- a/src/api/oauth/gitee.ts +++ b/src/api/oauth/gitee.ts @@ -11,7 +11,7 @@ export const getGiteeUrl = () => { }, cacheFor: { mode: "restore", - expire: 1000 * 60 * 60 * 24 * 30 // 30 days + expire: 1000 * 60 * 60 * 24 * 7 } } ); diff --git a/src/api/oauth/github.ts b/src/api/oauth/github.ts index d2dec7f..efd263b 100644 --- a/src/api/oauth/github.ts +++ b/src/api/oauth/github.ts @@ -14,7 +14,7 @@ export const getGithubUrl = (state: string) => { }, cacheFor: { mode: "restore", - expire: 1000 * 60 * 60 * 24 * 30 // 30 days + expire: 1000 * 60 * 60 * 24 * 7 } } ); diff --git a/src/api/oauth/index.ts b/src/api/oauth/index.ts index c3f003a..7d3ea60 100644 --- a/src/api/oauth/index.ts +++ b/src/api/oauth/index.ts @@ -27,7 +27,7 @@ export const generateClientId = () => { }, cacheFor: { mode: "restore", - expire: 1000 * 60 * 60 * 24 * 30 // 30天 + expire: 1000 * 60 * 60 * 24 * 7 } } ); diff --git a/src/api/oauth/qq.ts b/src/api/oauth/qq.ts index bcb69b0..9d7ba72 100644 --- a/src/api/oauth/qq.ts +++ b/src/api/oauth/qq.ts @@ -11,7 +11,7 @@ export const getQQUrl = (state: string) => { }, cacheFor: { mode: "restore", - expire: 1000 * 60 * 60 * 24 * 30 // 30 days + expire: 1000 * 60 * 60 * 24 * 7 } } ); diff --git a/src/api/oauth/wechat.ts b/src/api/oauth/wechat.ts index b3e898b..956c1f2 100644 --- a/src/api/oauth/wechat.ts +++ b/src/api/oauth/wechat.ts @@ -10,6 +10,7 @@ export const generateQrCode = (clientId: string) => { params: { client_id: clientId }, + cacheFor: 1000 * 60 * 60 * 24 * 7, meta: { ignoreToken: true, },