mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-11-29 02:42:51 +00:00
change ShouldBind -> ShouldBindWith + binding.Form
This commit is contained in:
parent
030adb5268
commit
0a6e02cf18
1 changed files with 3 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ import (
|
||||||
"github.com/mhsanaei/3x-ui/v2/web/session"
|
"github.com/mhsanaei/3x-ui/v2/web/session"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/gin-gonic/gin/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
// InboundController handles HTTP requests related to Xray inbounds management.
|
// InboundController handles HTTP requests related to Xray inbounds management.
|
||||||
|
|
@ -122,7 +123,8 @@ func (a *InboundController) addInbound(c *gin.Context) {
|
||||||
c.Request.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
|
c.Request.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
|
||||||
|
|
||||||
inbound := &model.Inbound{}
|
inbound := &model.Inbound{}
|
||||||
err := c.ShouldBind(inbound)
|
err := c.ShouldBindWith(inbound, binding.Form)
|
||||||
|
// err := c.ShouldBind(inbound)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
|
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue