From 2e5877cda9ffde6e5a0cdb09a5d037fcd94732e3 Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Mon, 26 Jun 2023 08:37:27 +0800 Subject: [PATCH] refactor: remove port from license domain --- .../setting/License/LicensePriceListModal.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/routes/setting/License/LicensePriceListModal.tsx b/src/routes/setting/License/LicensePriceListModal.tsx index a5808a69..5b903377 100644 --- a/src/routes/setting/License/LicensePriceListModal.tsx +++ b/src/routes/setting/License/LicensePriceListModal.tsx @@ -53,10 +53,15 @@ const LicensePriceListModal: FC = ({ closeModal }) => { }` ); const handleRenew = async () => { - if (!linkify.test(host)) { + const hostPrefixed = `https://${host}`; + if (!linkify.test(hostPrefixed)) { toast.error("Invalid Host"); return; } + if (new URL(hostPrefixed).port !== "" || host.endsWith(":443")) { + toast.error(t("license.tip_port")); + return; + } const [priceId, user_limit, type, sub_dur = "month"] = selectPrice.split("|") as [ string, string, @@ -120,15 +125,18 @@ const LicensePriceListModal: FC = ({ closeModal }) => { visible={popUpVisible} interactive placement="top-end" - offset={[0, -40]} + offset={[-50, -40]} trigger="click" content={ -
+
{t("license.tip_domain")}
- {t("license.tip_port")} -
+ + {" "} + {t("license.tip_port")} + +