修复 ip 获取

This commit is contained in:
xmdhs 2023-10-12 22:28:29 +08:00
parent 0ecef4a834
commit 8f227421f6
No known key found for this signature in database
GPG Key ID: E809D6D43DEFCC95
2 changed files with 2 additions and 2 deletions

View File

@ -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 />} />

View File

@ -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 {