14 lines
222 B
Go
14 lines
222 B
Go
package core
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
func JsonToString(postData interface{}) string {
|
|
jsons, errs := json.Marshal(postData) //转换成JSON返回的是byte[]
|
|
if errs != nil {
|
|
return ""
|
|
}
|
|
return string(jsons)
|
|
}
|