Skip to content

Commit

Permalink
修复类似 /a/b/c 的页面请求失败
Browse files Browse the repository at this point in the history
  • Loading branch information
movsb committed Aug 7, 2024
1 parent c1cbcf6 commit 6acecfe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/litao91/goldmark-mathjax v0.0.0-20210217064022-a43cf739a50f
github.com/mattn/go-sqlite3 v1.14.16
github.com/movsb/google-idtoken-verifier v0.0.0-20190329202541-1a6aa2c7e316
github.com/movsb/taorm v0.0.0-20240509064341-03180739c22c
github.com/movsb/taorm v0.0.0-20240807212532-f6a5b0a26586
github.com/mssola/user_agent v0.5.3
github.com/prometheus/client_golang v1.11.1
github.com/spf13/cobra v1.0.0
Expand All @@ -31,6 +31,7 @@ require (
github.com/movsb/pkg v0.0.0-20240609000755-7489894593e4
github.com/phuslu/lru v1.0.15
github.com/spf13/afero v1.11.0
github.com/xtaci/smux v1.5.24
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
go.abhg.dev/goldmark/hashtag v0.3.1
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17
Expand All @@ -50,7 +51,6 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xtaci/smux v1.5.24 // indirect
golang.org/x/crypto v0.22.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ github.com/movsb/google-idtoken-verifier v0.0.0-20190329202541-1a6aa2c7e316 h1:e
github.com/movsb/google-idtoken-verifier v0.0.0-20190329202541-1a6aa2c7e316/go.mod h1:yZbOV1cKd0igi4wBBcVrs4G2ooTWhjxUT9pYV5RDN44=
github.com/movsb/pkg v0.0.0-20240609000755-7489894593e4 h1:kuMEW9vTjkCF0lUu36IjIY/iXV+/1KBtLVSzof6vhQY=
github.com/movsb/pkg v0.0.0-20240609000755-7489894593e4/go.mod h1:hyHk9U4bOyLwcfLpjUjRI/Kz+lUeHRHL57u2UUDDLcM=
github.com/movsb/taorm v0.0.0-20240509064341-03180739c22c h1:2jPnw/yLpx6P5J9mDkWzwzEph1Lk8MklSZvbZmoGDvM=
github.com/movsb/taorm v0.0.0-20240509064341-03180739c22c/go.mod h1:gWYI7w8tEhmbDtRb6h5iqzoEs+/jHEhwxSy+Vlwn3dg=
github.com/movsb/taorm v0.0.0-20240807212532-f6a5b0a26586 h1:ELHLhWRNrRE3dmAs9djnueImGyf+bImD1NTZMwP6+nI=
github.com/movsb/taorm v0.0.0-20240807212532-f6a5b0a26586/go.mod h1:gWYI7w8tEhmbDtRb6h5iqzoEs+/jHEhwxSy+Vlwn3dg=
github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
github.com/mssola/user_agent v0.5.3 h1:lBRPML9mdFuIZgI2cmlQ+atbpJdLdeVl2IDodjBR578=
Expand Down
6 changes: 3 additions & 3 deletions service/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,9 @@ func (s *Service) getPageParentID(parents string) int64 {
found = true
break
}
if !found {
panic(fmt.Errorf("找不到父页面:%s", slugs[i]))
}
}
if !found {
panic(status.Errorf(codes.NotFound, "找不到父页面:%s", slugs[i]))
}
}

Expand Down

0 comments on commit 6acecfe

Please sign in to comment.