修改md5加密算法
This commit is contained in:
parent
c9845b7552
commit
00436a10e9
|
|
@ -20,7 +20,7 @@ local function authenticate(name, passwd)
|
|||
if passwd == "" then
|
||||
return 0x010002, nil
|
||||
end
|
||||
local pwdMd5 = ngx.encode_md5(passwd)
|
||||
local pwdMd5 = ngx.md5(passwd)
|
||||
--根据用户进行验证用户是否存在
|
||||
local code, res = userModel:where("username", "=", name):where("password", "=", pwdMd5):get()
|
||||
if code == 0 and res ~= nil then
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ function _M.addSystemUser(jsonData)
|
|||
jsonData.id = helpers.getUuid()
|
||||
--用户密码暂时使用md5进行加密
|
||||
local pwd = jsonData['password']
|
||||
jsonData.password = ngx.encode_md5(pwd)
|
||||
jsonData.password = ngx.md5(pwd)
|
||||
-- 创建一个用户
|
||||
return userModel:create(jsonData)
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user