fix: 修复导出配置 JSON 特殊字符被转义的问题
This commit is contained in:
parent
9f27102d3a
commit
193763e471
|
@ -377,13 +377,21 @@ func (slf *Config) String() string {
|
|||
}
|
||||
|
||||
func (slf *Config) JsonServer() []byte {
|
||||
d, _ := jsonIter.MarshalIndent(slf.dataServer, "", " ")
|
||||
return d
|
||||
buffer := &bytes.Buffer{}
|
||||
encoder := jsonIter.NewEncoder(buffer)
|
||||
encoder.SetEscapeHTML(false)
|
||||
encoder.SetIndent("", " ")
|
||||
_ = encoder.Encode(slf.dataServer)
|
||||
return buffer.Bytes()
|
||||
}
|
||||
|
||||
func (slf *Config) JsonClient() []byte {
|
||||
d, _ := jsonIter.MarshalIndent(slf.dataClient, "", " ")
|
||||
return d
|
||||
buffer := &bytes.Buffer{}
|
||||
encoder := jsonIter.NewEncoder(buffer)
|
||||
encoder.SetEscapeHTML(false)
|
||||
encoder.SetIndent("", " ")
|
||||
_ = encoder.Encode(slf.dataClient)
|
||||
return buffer.Bytes()
|
||||
}
|
||||
|
||||
func (slf *Config) GetVariable() string {
|
||||
|
|
Loading…
Reference in New Issue