Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

feat: site_url valiadtor add base_path

shuai84c8b3f416de
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 !== ''
) {