improve CORS feature for ghttp.Server

This commit is contained in:
John
2019-09-03 17:18:16 +08:00
parent e2906fba0b
commit cd00ac446b
10 changed files with 83 additions and 66 deletions

View File

@ -11,6 +11,7 @@ import (
"errors"
"fmt"
"reflect"
"strings"
"github.com/gogf/gf/util/gconv"
)
@ -216,7 +217,9 @@ func (md *Model) GroupBy(groupBy string) *Model {
// 链式操作order by
func (md *Model) OrderBy(orderBy string) *Model {
model := md.getModel()
model.orderBy = orderBy
array := strings.Split(orderBy, " ")
array[0] = md.db.quoteWord(array[0])
model.orderBy = strings.Join(array, " ")
return model
}