ITeye博客

Lua语法

leon1509 · 2017-01-22 09:12 · lua · 企业架构 · Markdown

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")

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。