updateuser
This commit is contained in:
@@ -2,6 +2,8 @@ package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"git.rosy.net.cn/jx-print/globals"
|
||||
"git.rosy.net.cn/jx-print/model"
|
||||
"github.com/dchest/captcha"
|
||||
"github.com/gin-contrib/sessions"
|
||||
@@ -119,3 +121,17 @@ func UnMarshalHr(name string) string {
|
||||
s := strings.ToLower(buf.String())
|
||||
return s
|
||||
}
|
||||
|
||||
func UnmarshalUseNumber(data []byte, result interface{}) error {
|
||||
err := TryUnmarshalUseNumber(data, result)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Infof("decode data:%v, error:%v", string(data), err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func TryUnmarshalUseNumber(data []byte, result interface{}) error {
|
||||
d := json.NewDecoder(bytes.NewReader(data))
|
||||
d.UseNumber()
|
||||
return d.Decode(result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user