Skip to content

Commit fea8f8d

Browse files
committed
统一code
1 parent 8743d3e commit fea8f8d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

http/response/send.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,8 @@ func Failed(w http.ResponseWriter, err error) {
2626
errCode = exception.UnKnownException
2727
}
2828

29-
// 映射http status code 1xx - 5xx
30-
// 如果为其他errCode, 统一成200
31-
if errCode/100 >= 1 && errCode/100 <= 5 {
32-
httpCode = errCode
33-
} else {
34-
httpCode = http.StatusOK
35-
}
29+
// 统一使用业务code, http code固定200
30+
httpCode = http.StatusOK
3631

3732
resp := Data{
3833
Code: &errCode,

0 commit comments

Comments
 (0)