修改请求返回参数问题

This commit is contained in:
wanglei 2025-11-19 11:37:50 +08:00
parent 8a994fe9d6
commit ef5a02baea

View File

@ -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