Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
黄南光
/
wiki_knowledge
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0d3ac9d9
authored
Jun 25, 2026
by
黄南光
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复前端接口地址被域名替换的问题
API_BASE 优先读取 NEXT_PUBLIC_API_URL,避免按访问域名拼接接口地址
1 parent
e4759251
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
frontend/src/app/page.tsx
frontend/src/app/wiki-repo/page.tsx
frontend/src/app/page.tsx
View file @
0d3ac9d
...
@@ -171,7 +171,7 @@ export default function EnterpriseWiki() {
...
@@ -171,7 +171,7 @@ export default function EnterpriseWiki() {
// Selection state
// Selection state
const [selectedIds, setSelectedIds] = useState<Set<string>>(new Set());
const [selectedIds, setSelectedIds] = useState<Set<string>>(new Set());
const API_BASE =
typeof window !== 'undefined' ? `http://${window.location.hostname}:8104` : "http://127.0.0.1:8104"
;
const API_BASE =
process.env.NEXT_PUBLIC_API_URL || (typeof window !== 'undefined' ? `http://${window.location.hostname}:8104` : "http://127.0.0.1:8104")
;
const fetchFiles = async (page = currentPage, size = pageSize, search = searchQuery, isInitial = false) => {
const fetchFiles = async (page = currentPage, size = pageSize, search = searchQuery, isInitial = false) => {
if (isInitial) setIsInitialLoading(true);
if (isInitial) setIsInitialLoading(true);
...
...
frontend/src/app/wiki-repo/page.tsx
View file @
0d3ac9d
...
@@ -6,7 +6,7 @@ import ReactMarkdown from "react-markdown";
...
@@ -6,7 +6,7 @@ import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
import remarkGfm from "remark-gfm";
import { cn } from "@/lib/utils";
import { cn } from "@/lib/utils";
const API_BASE =
typeof window !== 'undefined' ? `http://${window.location.hostname}:8104` : "http://127.0.0.1:8104"
;
const API_BASE =
process.env.NEXT_PUBLIC_API_URL || (typeof window !== 'undefined' ? `http://${window.location.hostname}:8104` : "http://127.0.0.1:8104")
;
interface TreeNodeData {
interface TreeNodeData {
name: string;
name: string;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment