This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch feat/basepath
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/feat/basepath by this push:
     new 84c8b3f4 feat: site_url valiadtor add base_path
84c8b3f4 is described below

commit 84c8b3f416def830cace8dd653266878e7b78961
Author: shuai <[email protected]>
AuthorDate: Tue Apr 23 15:05:19 2024 +0800

    feat: site_url valiadtor add base_path
---
 ui/src/pages/Admin/General/index.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ui/src/pages/Admin/General/index.tsx 
b/ui/src/pages/Admin/General/index.tsx
index 3c6ff51a..a84844ef 100644
--- a/ui/src/pages/Admin/General/index.tsx
+++ b/ui/src/pages/Admin/General/index.tsx
@@ -27,6 +27,7 @@ import { siteInfoStore } from '@/stores';
 import { useGeneralSetting, updateGeneralSetting } from '@/services';
 import Pattern from '@/common/pattern';
 import { handleFormError } from '@/utils';
+import { REACT_BASE_PATH } from '@/router/alias';
 
 const General: FC = () => {
   const { t } = useTranslation('translation', {
@@ -90,7 +91,8 @@ const General: FC = () => {
           if (
             !url ||
             !/^https?:$/.test(url.protocol) ||
-            url.pathname !== '/' ||
+            (REACT_BASE_PATH && url.pathname !== REACT_BASE_PATH) ||
+            (!REACT_BASE_PATH && url.pathname !== '/') ||
             url.search !== '' ||
             url.hash !== ''
           ) {

Reply via email to