修改请求返回参数问题
This commit is contained in:
parent
8a994fe9d6
commit
ef5a02baea
|
|
@ -139,9 +139,10 @@ local function authorizateCode(args)
|
||||||
-- 1.校验必填参数验证数据是否符合json
|
-- 1.校验必填参数验证数据是否符合json
|
||||||
local ok = validator.validateToken(args)
|
local ok = validator.validateToken(args)
|
||||||
if not ok then
|
if not ok then
|
||||||
resp:response(status.TOKEN_INVALID)
|
resp:response(status.PARAM_IS_INVALID)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
print("consume code:", args.code)
|
||||||
-- 2.校验 code 有效性
|
-- 2.校验 code 有效性
|
||||||
local code_data, err = authcode.consume(args.code)--, args.client_id)
|
local code_data, err = authcode.consume(args.code)--, args.client_id)
|
||||||
if not code_data then
|
if not code_data then
|
||||||
|
|
@ -234,6 +235,9 @@ end
|
||||||
function _M:token()
|
function _M:token()
|
||||||
-- 1. 解析请求参数(支持 form-data 和 json)
|
-- 1. 解析请求参数(支持 form-data 和 json)
|
||||||
local args = getUriArgs()
|
local args = getUriArgs()
|
||||||
|
if args == nil then
|
||||||
|
ngx.exit(ngx.HTTP_BAD_REQUEST)
|
||||||
|
end
|
||||||
local grant_type = args.grant_type
|
local grant_type = args.grant_type
|
||||||
--print("grant_type类型: ", grant_type)
|
--print("grant_type类型: ", grant_type)
|
||||||
if grant_type == "password" then
|
if grant_type == "password" then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user