异常状态码若为成功, 文案后不带状态码后缀

This commit is contained in:
白茶清欢 2022-07-03 01:12:32 +08:00
parent 54b77a714f
commit b301bd1849
2 changed files with 5 additions and 3 deletions

View File

@ -4,9 +4,7 @@
<option name="autoReloadType" value="ALL" />
</component>
<component name="ChangeListManager">
<list default="true" id="0c7a619f-b520-4d41-ab0d-cfa1799d3cdf" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/code.go" beforeDir="false" afterPath="$PROJECT_DIR$/code.go" afterDir="false" />
</list>
<list default="true" id="0c7a619f-b520-4d41-ab0d-cfa1799d3cdf" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />

View File

@ -75,6 +75,10 @@ func getMessage(code interface{}) string {
return fmt.Sprintf("未知错误【%v】", codeTable)
}
if messageWithCode {
if code == defaultSuccessCode {
// 请求成功, 一直不带状态码后缀
return message[defaultLanguage]
}
return fmt.Sprintf(message[defaultLanguage]+"【%v】", code)
}
return message[defaultLanguage]