From 6cc7bc466b7779c11dd44f1564f30b8933ee0947 Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Mon, 12 Dec 2022 17:52:22 +0800 Subject: [PATCH] feat: license error tip --- src/app/services/base.query.ts | 11 +++++++++++ src/routes/login/index.tsx | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/services/base.query.ts b/src/app/services/base.query.ts index ca99a660..811ddbdf 100644 --- a/src/app/services/base.query.ts +++ b/src/app/services/base.query.ts @@ -102,6 +102,17 @@ const baseQueryWithTokenCheck = async (args, api, extraOptions) => { } } break; + case 451: + { + // 证书错误 + if (api.endpoint !== "login") { + // 退出登录 + api.dispatch(resetAuthData()); + location.href = "/#/login"; + } + toast.error(result.error.data || "License Error"); + } + break; case 500: case 503: { diff --git a/src/routes/login/index.tsx b/src/routes/login/index.tsx index c3c20957..2913e5fb 100644 --- a/src/routes/login/index.tsx +++ b/src/routes/login/index.tsx @@ -74,8 +74,8 @@ export default function LoginPage() { "No associated account found, please contact user admin for an invitation link to join." ); break; - case 451: - toast.error("License error: Domain incorrect!"); + // 451有解析错误,暂时先客户端处理 + case "PARSING_ERROR": break; default: toast.error("Something Error");