diff --git a/src/webui/src/api/Auth.ts b/src/webui/src/api/QQLogin.ts similarity index 100% rename from src/webui/src/api/Auth.ts rename to src/webui/src/api/QQLogin.ts diff --git a/src/webui/src/helper/Data.ts b/src/webui/src/helper/Data.ts new file mode 100644 index 00000000..8d775556 --- /dev/null +++ b/src/webui/src/helper/Data.ts @@ -0,0 +1,17 @@ +let LoginRuntime = { + LoginCurrentTime: Date.now(), + LoginCurrentRate: 0 +} +export const Data = { + checkLoginRate: async function (RateLimit: number): Promise { + if (Date.now() - LoginRuntime.LoginCurrentTime > 1000 * 60) { + LoginRuntime.LoginCurrentRate = 0;//超出时间重置限速 + return true; + } + if (LoginRuntime.LoginCurrentRate <= RateLimit) { + LoginRuntime.LoginCurrentRate++; + return true; + } + return false; + } +} \ No newline at end of file diff --git a/src/webui/src/helper/Auth.ts b/src/webui/src/helper/SignToken.ts similarity index 100% rename from src/webui/src/helper/Auth.ts rename to src/webui/src/helper/SignToken.ts diff --git a/src/webui/src/common/config.ts b/src/webui/src/helper/config.ts similarity index 100% rename from src/webui/src/common/config.ts rename to src/webui/src/helper/config.ts diff --git a/static/authlogin.html b/static/QQLogin.html similarity index 100% rename from static/authlogin.html rename to static/QQLogin.html diff --git a/static/index.html b/static/index.html index d01f779f..fc2d1b22 100644 --- a/static/index.html +++ b/static/index.html @@ -3,7 +3,7 @@ - Document + WebUi - Index