fixed incorrect type when changing character costume

This commit is contained in:
2026-09-14 18:28:44 +08:00
parent 000b498f0e
commit c4154581a6
2 changed files with 5 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
package main package main
import ( import (
"bdgrp_go/master"
"fmt" "fmt"
"log" "log"
"os" "os"
@@ -81,5 +82,6 @@ func main() {
} }
}() }()
go master.ReloadMaster()
app.Listen(PORT) app.Listen(PORT)
} }

View File

@@ -6,6 +6,7 @@ import (
"bdgrp_go/routes" "bdgrp_go/routes"
"bdgrp_go/utils" "bdgrp_go/utils"
"fmt" "fmt"
"strconv"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
) )
@@ -27,7 +28,8 @@ func changeCostume(c *fiber.Ctx) error {
wearingCostume := user["wearingCostume"].(map[string]any) wearingCostume := user["wearingCostume"].(map[string]any)
costume := wearingCostume[characterid].(map[string]any) costume := wearingCostume[characterid].(map[string]any)
costume["costumeId"] = costumeid cid, _ := strconv.Atoi(costumeid)
costume["costumeId"] = cid
db.Save() db.Save()
charMap := map[string]any{} charMap := map[string]any{}