From 161cd2b1eada2045219ff20f9370defa5402d21d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 2 Jun 2024 19:28:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E4=B8=BB=E5=AD=90=E8=A1=A8=E5=85=B3=E8=81=94=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/SysLoginService.java | 2 +- .../src/main/resources/vm/xml/mapper.xml.vm | 25 +++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index 4831849d..97abcead 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -115,12 +115,12 @@ public class SysLoginService { String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); String captcha = redisCache.getCacheObject(verifyKey); - redisCache.deleteObject(verifyKey); if (captcha == null) { AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"))); throw new CaptchaExpireException(); } + redisCache.deleteObject(verifyKey); if (!code.equalsIgnoreCase(captcha)) { AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); diff --git a/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm b/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm index 5b704e73..234ac67d 100644 --- a/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm +++ b/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm @@ -12,12 +12,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #if($table.sub) - + #foreach ($column in $subTable.columns) - + #end #end @@ -63,15 +63,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where ${pkColumn.columnName} = #{${pkColumn.javaField}} #elseif($table.sub) - select#foreach($column in $columns) a.$column.columnName#if($foreach.count != $columns.size()),#end#end, - #foreach($column in $subTable.columns) b.$column.columnName as sub_$column.columnName#if($foreach.count != $subTable.columns.size()),#end#end - - from ${tableName} a - left join ${subTableName} b on b.${subTableFkName} = a.${pkColumn.columnName} - where a.${pkColumn.columnName} = #{${pkColumn.javaField}} + select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end + from ${tableName} + where ${pkColumn.columnName} = #{${pkColumn.javaField}} #end - +#if($table.sub) + + +#end + insert into ${tableName} @@ -127,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end) values - + (#foreach($column in $subTable.columns) #{item.$column.javaField}#if($foreach.count != $subTable.columns.size()),#end#end)