优化hhsh

This commit is contained in:
liyp 2024-04-14 22:25:13 +08:00
parent c5b0fe3bb5
commit e6a67581d7

View file

@ -44,7 +44,7 @@ func (a *Hhsh) GetMsg() string {
return err.Error()
}
resultSlipe := data["data"].([]interface{})
// fmt.Println("resultSlipe:", resultSlipe)
fmt.Println("resultSlipe:", resultSlipe)
if trans, ok := resultSlipe[0].(map[string]interface{})["trans"]; ok {
// println("trans:", trans.([]interface{}))
transSlice := trans.([]interface{})
@ -56,5 +56,5 @@ func (a *Hhsh) GetMsg() string {
return msg
}
// return string(resultSlipe[0].([]byte))
return "未找到关于" + resultSlipe[0].(map[string]interface{})["trans"].([]interface{})[0].(string) + "的释义"
return "未找到关于 " + parms[1] + " 的释义"
}