Lua语法

if not res then

    ngx.log()

    return ngx.exit(500)

end

ngx.log()

.....

==============================

local data = ngx.req.get_body_data()

             if data then

                 ngx.say("body data:")

                 ngx.print(data)

                 return

             end

==================================

local result, err = user_model:query(user_id)

if not result or err then

    ......

end

 

 

=========== 函数传多个参数=========

1. 

function _M.isNulls(...)

    for i, v in ipairs(arg) do

       if isNull(v) then

            return false

       end

    end

end

2. 

function testcase(...)

local arg = {...}

a = arg[1]

print(a)

ngx.say(a)

end

testcase("123", "456", "789")

猜你喜欢

转载自leon1509.iteye.com/blog/2354403