From ef5a02baeae2ec830f16e182479f37825fd21f88 Mon Sep 17 00:00:00 2001 From: wanglei <34475144@qqcom> Date: Wed, 19 Nov 2025 11:37:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=8F=82=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/oauth/oauth.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/service/oauth/oauth.lua b/src/service/oauth/oauth.lua index 471b93d..4bfa51a 100644 --- a/src/service/oauth/oauth.lua +++ b/src/service/oauth/oauth.lua @@ -139,9 +139,10 @@ local function authorizateCode(args) -- 1.校验必填参数验证数据是否符合json local ok = validator.validateToken(args) if not ok then - resp:response(status.TOKEN_INVALID) + resp:response(status.PARAM_IS_INVALID) return end + print("consume code:", args.code) -- 2.校验 code 有效性 local code_data, err = authcode.consume(args.code)--, args.client_id) if not code_data then @@ -234,6 +235,9 @@ end function _M:token() -- 1. 解析请求参数(支持 form-data 和 json) local args = getUriArgs() + if args == nil then + ngx.exit(ngx.HTTP_BAD_REQUEST) + end local grant_type = args.grant_type --print("grant_type类型: ", grant_type) if grant_type == "password" then