未验证 提交 cdf65a92 编写于 作者: 无星夜 提交者: GitHub

Fix invalid orderKey (#950)

* fix unmatched type of id field

* fix invalid order key
上级 3ab05808
......@@ -2,6 +2,7 @@ package system
import (
"errors"
"fmt"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
......@@ -89,6 +90,9 @@ func (apiService *ApiService) GetAPIInfoList(api system.SysApi, info request.Pag
} else {
OrderStr = order
}
} else { // didn't matched any order key in `orderMap`
err = fmt.Errorf("非法的排序字段: %v", order)
return err, apiList, total
}
err = db.Order(OrderStr).Find(&apiList).Error
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册