style: 错误信息英文返回-lib包
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user