diff --git a/code.go b/code.go index 576daed..6716c1a 100644 --- a/code.go +++ b/code.go @@ -57,6 +57,9 @@ func InitCodeTableWithMessage(table map[interface{}]map[string]string, convertDe // Date : 16:19 2023/6/9 func InitCodeTableWithCodeList(list []Code, convertDefaultSuccessCode interface{}, convertDefaultLanguage string) { for _, itemCode := range list { + if itemCode.Reason == nil || len(itemCode.Reason) == 0 { + itemCode.Reason = itemCode.Message + } codeTable[itemCode.Value] = itemCode } if nil == convertDefaultSuccessCode {