mirror of
https://gitcode.com/flipped-aurora/gin-vue-admin.git
synced 2026-05-13 10:52:34 +00:00
shouldBind 修改为 shouldBindJSON 防止浏览器ajax交互时 content-type出现偶发性不同的问题
This commit is contained in:
@@ -31,7 +31,7 @@ func GetSystemConfig(c *gin.Context) {
|
||||
// @Router /system/setSystemConfig [post]
|
||||
func SetSystemConfig(c *gin.Context) {
|
||||
var sys sysModel.System
|
||||
_ = c.ShouldBind(&sys)
|
||||
_ = c.ShouldBindJSON(&sys)
|
||||
err := sys.SetSystemConfig()
|
||||
if err != nil {
|
||||
servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{})
|
||||
@@ -49,7 +49,7 @@ func SetSystemConfig(c *gin.Context) {
|
||||
// @Router /system/ReloadSystem [post]
|
||||
func ReloadSystem(c *gin.Context) {
|
||||
var sys sysModel.System
|
||||
_ = c.ShouldBind(&sys)
|
||||
_ = c.ShouldBindJSON(&sys)
|
||||
err := sys.SetSystemConfig()
|
||||
if err != nil {
|
||||
servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{})
|
||||
|
||||
Reference in New Issue
Block a user