修改md5加密算法

This commit is contained in:
wanglei 2025-11-04 22:24:08 +08:00
parent c9845b7552
commit 00436a10e9
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ local function authenticate(name, passwd)
if passwd == "" then if passwd == "" then
return 0x010002, nil return 0x010002, nil
end end
local pwdMd5 = ngx.encode_md5(passwd) local pwdMd5 = ngx.md5(passwd)
--根据用户进行验证用户是否存在 --根据用户进行验证用户是否存在
local code, res = userModel:where("username", "=", name):where("password", "=", pwdMd5):get() local code, res = userModel:where("username", "=", name):where("password", "=", pwdMd5):get()
if code == 0 and res ~= nil then if code == 0 and res ~= nil then

View File

@ -73,7 +73,7 @@ function _M.addSystemUser(jsonData)
jsonData.id = helpers.getUuid() jsonData.id = helpers.getUuid()
--用户密码暂时使用md5进行加密 --用户密码暂时使用md5进行加密
local pwd = jsonData['password'] local pwd = jsonData['password']
jsonData.password = ngx.encode_md5(pwd) jsonData.password = ngx.md5(pwd)
-- 创建一个用户 -- 创建一个用户
return userModel:create(jsonData) return userModel:create(jsonData)
end end