fix: 修复导出配置 JSON 特殊字符被转义的问题

This commit is contained in:
kercylan98 2023-07-06 09:21:32 +08:00
parent 9f27102d3a
commit 193763e471
1 changed files with 12 additions and 4 deletions

View File

@ -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 {