From 00436a10e91c2a9417627daab81fe3603389d1d1 Mon Sep 17 00:00:00 2001 From: wanglei <34475144@qq.com> Date: Tue, 4 Nov 2025 22:24:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9md5=E5=8A=A0=E5=AF=86?= =?UTF-8?q?=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dao/auth.lua | 2 +- src/dao/user.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dao/auth.lua b/src/dao/auth.lua index bc83446..9cec4d7 100644 --- a/src/dao/auth.lua +++ b/src/dao/auth.lua @@ -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 diff --git a/src/dao/user.lua b/src/dao/user.lua index 020bc7b..92322cb 100644 --- a/src/dao/user.lua +++ b/src/dao/user.lua @@ -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