🐛 Fix userinfo insert into wrong table

This commit is contained in:
LittleSheep 2024-09-14 21:37:14 +08:00
parent 14e3750bd9
commit 5b78292d1b
3 changed files with 5 additions and 2 deletions

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.22
toolchain go1.22.1 toolchain go1.22.1
require ( require (
git.solsynth.dev/hydrogen/dealer v0.0.0-20240911145828-d734d617bfc8 git.solsynth.dev/hydrogen/dealer v0.0.0-20240914133539-4a48b980f0b3
github.com/go-playground/validator/v10 v10.17.0 github.com/go-playground/validator/v10 v10.17.0
github.com/gofiber/fiber/v2 v2.52.4 github.com/gofiber/fiber/v2 v2.52.4
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0

2
go.sum
View File

@ -1,5 +1,7 @@
git.solsynth.dev/hydrogen/dealer v0.0.0-20240911145828-d734d617bfc8 h1:kWheneSdSySG5tz9TAXrtr546JdMpQZTyWDFk4jeGwg= git.solsynth.dev/hydrogen/dealer v0.0.0-20240911145828-d734d617bfc8 h1:kWheneSdSySG5tz9TAXrtr546JdMpQZTyWDFk4jeGwg=
git.solsynth.dev/hydrogen/dealer v0.0.0-20240911145828-d734d617bfc8/go.mod h1:Q51JPkKnV0UoOT/IRmdBh5CyfSlp7s8BRGzgooYHqkI= git.solsynth.dev/hydrogen/dealer v0.0.0-20240911145828-d734d617bfc8/go.mod h1:Q51JPkKnV0UoOT/IRmdBh5CyfSlp7s8BRGzgooYHqkI=
git.solsynth.dev/hydrogen/dealer v0.0.0-20240914133539-4a48b980f0b3 h1:ucko8l9rC/XD/Gfk9lcQftyqb9tvHjL5f+aW3ydf1OI=
git.solsynth.dev/hydrogen/dealer v0.0.0-20240914133539-4a48b980f0b3/go.mod h1:Q51JPkKnV0UoOT/IRmdBh5CyfSlp7s8BRGzgooYHqkI=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=

View File

@ -55,10 +55,11 @@ func NewServer() {
Output: log.Logger, Output: log.Logger,
})) }))
tablePrefix := viper.GetString("database.prefix")
app.Use(gap.H.AuthMiddleware) app.Use(gap.H.AuthMiddleware)
app.Use(hyper.LinkAccountMiddleware( app.Use(hyper.LinkAccountMiddleware(
database.C, database.C,
&models.Account{}, tablePrefix+"accounts",
func(u hyper.BaseUser) models.Account { func(u hyper.BaseUser) models.Account {
return models.Account{ return models.Account{
BaseUser: u, BaseUser: u,