Skip to content

Commit

Permalink
修复 ip 获取
Browse files Browse the repository at this point in the history
  • Loading branch information
xmdhs committed Oct 12, 2023
1 parent 0ecef4a commit 8f22742
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/Route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Root() {
<>
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<p>123</p>} />
<Route index />
<Route path="/*" element={<p>404</p>} />
<Route path="/login" element={<Login />} />
<Route path="/register" element={<Register />} />
Expand Down
2 changes: 1 addition & 1 deletion utils/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
func GetIP(r *http.Request) (string, error) {
ip, _, err := net.SplitHostPort(r.RemoteAddr)
if err != nil {
return "", err
ip = r.RemoteAddr
}
netIP := net.ParseIP(ip)
if netIP != nil {
Expand Down

0 comments on commit 8f22742

Please sign in to comment.