style: 错误信息英文返回-lib包

This commit is contained in:
TsMask
2023-11-08 15:00:54 +08:00
parent 81138b8c22
commit c53cd9ce16
6 changed files with 48 additions and 51 deletions

View File

@@ -138,20 +138,14 @@ func ExtGetUriPageLimitString(r *http.Request) string {
}
func IsJsonContentType(r *http.Request) bool {
if strings.Contains(r.Header.Get("Content-Type"), "application/json") {
return true
}
return false
hType := r.Header.Get("Content-Type")
return strings.Contains(hType, "application/json")
}
func IsValidOAuthUri(r *http.Request) bool {
vars := mux.Vars(r)
apiVer := vars["apiVersion"] // 获取Uri
if apiVer != "v1" {
return false
}
return true
return apiVer == "v1"
}
func IsVallidContentType(r *http.Request, checkFlag bool) bool {
@@ -386,7 +380,7 @@ func CheckCommonValidRequest(w http.ResponseWriter, r *http.Request) (string, er
// error processing ...
// 401-1 response
token, ret = oauth.IsCarriedToken(r)
if ret == false {
if !ret {
log.Error("accessToken is not carried")
ResponseUnauthorized401AccessTokenNotCarried(w)
return token, err