优化doc

This commit is contained in:
MMS 2025-09-01 22:48:39 +08:00
parent 94f19d5e9c
commit 04ba8d1539
9 changed files with 57475 additions and 23 deletions

View File

@ -53,7 +53,7 @@ public class SysUserBo extends BaseEntity {
* 用户账号
*/
@NotBlank(message = "账号不能为空", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
@Size(min = 3, max = 20, message = "账号长度在3到20之间", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
@Size(min = 4, max = 20, message = "账号长度在5到20之间", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
private String userName;
/**

View File

@ -99,20 +99,20 @@ public class SysLoginServiceImpl implements SysLoginService {
if(sysConfigService.getIsOpenCaptcha()){
if(StringUtil.isEmpty(code)){
throw new MmsException("验证码不能为空");
throw new MmsException("The verification code cannot be empty");
}
Map<String, Object> data = RedisUtil.getCacheObject(uuid);
if (ObjectUtils.isEmpty(data)) {
log.info("登录:验证码失效!");
throw new LoginException("验证码失效");
throw new LoginException("Verification code failure");
}
if (!codeKey.equals(data.get(CaptchaEntity.CODE.CAPTCHA_KEY.getValue()))) {
log.info("登录:验证码与验证对象不匹配!");
throw new LoginException("验证码与验证对象不匹配");
throw new LoginException("Verification code does not match the verification object");
}
if (!code.equalsIgnoreCase((String) data.get(CaptchaEntity.CODE.CAPTCHA_VALUE.getValue()))) {
log.info("登录:验证码不匹配!");
throw new LoginException("验证码不匹配");
throw new LoginException("Verification code does not match");
}
}
return;
@ -130,11 +130,11 @@ public class SysLoginServiceImpl implements SysLoginService {
SysTenant sysTenant = sysTenantService.selectById(sysUser.getTenantId());
if (ObjectUtils.isEmpty(sysTenant)) {
log.info("登录用户ID{} 租户不存在.", sysUser.getUserId());
throw new TenantException("租户不存在");
throw new TenantException("tenant.not.exists");
}
if (!sysTenant.getStatus().equals(SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue())) {
log.info("登录用户ID{} 租户状态为禁用.", sysUser.getUserId());
throw new TenantException("租户状态为禁用");
throw new TenantException("tenant off state");
}
}

View File

@ -123,6 +123,7 @@ public class SysOssConfigServiceImpl extends BaseServiceImpl<SysOssConfig, SysOs
baseMapper.update(null, new LambdaUpdateWrapper<SysOssConfig>().set(SysOssConfig::getStatus, SystemCommonEnum.SYS_COMMON_STATE_CLOSE.getValue()).eq(SysOssConfig::getStatus, SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue()));
}
bo.setId(configVo.getId());
bo.setRevision(configVo.getRevision());
row = baseMapper.updateById(MapstructUtil.convert(bo, SysOssConfig.class));
} else {
if (bo.getStatus().toString().equals(SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue().toString()) ) {
@ -141,7 +142,7 @@ public class SysOssConfigServiceImpl extends BaseServiceImpl<SysOssConfig, SysOs
@Override
public List<FileStorageConfig> getOss() {
//
List<SysOssConfigVo> vos = baseMapper.selectVoList(new LambdaQueryWrapper<SysOssConfig>().orderByAsc(SysOssConfig::getStatus));
List<SysOssConfigVo> vos = baseMapper.selectVoList(new LambdaQueryWrapper<SysOssConfig>().orderByDesc(SysOssConfig::getStatus));
List<FileStorageConfig> list = new ArrayList<>();
for (SysOssConfigVo configVo : vos) {
if (configVo != null) {

View File

@ -5,36 +5,36 @@
#菜单
INSERT INTO `sys_function`(`parent_id`,`path`,`name`,`component`,`language_code`,`type`,`sort`,`icon`,`status`,`visible`,`is_iframe`,`is_open_link`,`is_link`,`keep_alive`,`always_show`,`tenant_id`,`created_time`,`updated_time`,`revision`)
values (${menuId},'/${moduleName}/${functionName}','${tableComment}','${moduleName}/${functionName}/index','${tableComment}',1,1,'',0,-1,-1,-1,'',1,-1,'000000',${dbTime},${dbTime},1);
values (${menuId},'/${moduleName}/${functionName}','${tableComment}','${moduleName}/${functionName}/index','${tableComment}',1,1,'',1,-1,-1,-1,'',1,-1,'000000',${dbTime},${dbTime},1);
#列表
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-列表','${moduleName}:${functionName}:list',2,2,0,'000000',${dbTime},${dbTime},1);
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-列表','${moduleName}:${functionName}:list',2,2,1,'000000',${dbTime},${dbTime},1);
#新增
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-新增','${moduleName}:${functionName}:insert',2,3,0,'000000',${dbTime},${dbTime},1);
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-新增','${moduleName}:${functionName}:insert',2,3,1,'000000',${dbTime},${dbTime},1);
#删除
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-删除','${moduleName}:${functionName}:delete',2,4,0,'000000',${dbTime},${dbTime},1);
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-删除','${moduleName}:${functionName}:delete',2,4,1,'000000',${dbTime},${dbTime},1);
#编辑
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-编辑','${moduleName}:${functionName}:edit',2,5,0,'000000',${dbTime},${dbTime},1);
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-编辑','${moduleName}:${functionName}:edit',2,5,1,'000000',${dbTime},${dbTime},1);
#查询
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-查询','${moduleName}:${functionName}:query',2,6,0,'000000',${dbTime},${dbTime},1);
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-查询','${moduleName}:${functionName}:query',2,6,1,'000000',${dbTime},${dbTime},1);
#导入
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-导入','${moduleName}:${functionName}:import',2,6,0,'000000',${dbTime},${dbTime},1);
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-导入','${moduleName}:${functionName}:import',2,7,1,'000000',${dbTime},${dbTime},1);
#导出
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-导出','${moduleName}:${functionName}:export',2,6,0,'000000',${dbTime},${dbTime},1);
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-导出','${moduleName}:${functionName}:export',2,8,1,'000000',${dbTime},${dbTime},1);
#打印
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-打印','${moduleName}:${functionName}:print',2,6,0,'000000',${dbTime},${dbTime},1);
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-打印','${moduleName}:${functionName}:print',2,9,1,'000000',${dbTime},${dbTime},1);

View File

@ -135,7 +135,12 @@
<script setup lang="ts" name="${moduleName}${FunctionName}Dialog">
import {nextTick, reactive, ref} from "vue";
import {CURDEnum} from '/@/enums/CURDEnum';
import {ElMessage} from "element-plus";
import {${FunctionName}Bo, ${FunctionName}Vo} from '/@/views/${moduleName}/${functionName}/type';
<#if formLayout==2 >
import {${functionName}Api} from '/@/views/${moduleName}/${functionName}';
const baseApi = ${functionName}Api();
</#if>
const dialogWidth = ref('50vw');
<#list fastList as field>
@ -154,6 +159,9 @@
import FastSwitch from "/@/components/fast-switch/src/fast-switch.vue";
</#if>
</#list>
// 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh']);
const dialogFormRef = ref();
@ -176,7 +184,9 @@
<#list fieldList as field>
<#if !field.baseField||field.attrName =='status'||field.attrName =='sort'||field.attrName =='remark'>
<#if field.fieldType == 'int'>
<#if field.attrName =='sort'>
<#if field.attrName =='status'>
${field.attrName}: 1<#sep>,
<#elseif field.attrName =='sort'>
${field.attrName}: 1<#sep>,
<#else>
${field.attrName}: 0<#sep>,
@ -237,7 +247,7 @@
}
<#if formLayout==2 >
// 选择监听
const change = (arr: number[]) => {
const change = (arr: string[]) => {
state.ruleForm.${tableParentId} = arr[arr.length - 1];
};
</#if>

View File

@ -227,7 +227,7 @@
</#if>
</#list>
<#if formLayout==2 >
,isAll:true,
isAll:true,
</#if>
}
}

View File

@ -8,8 +8,12 @@ import lombok.Data;
*/
@Data
public class ThreeQueryBo {
//true全部数据 false有效数据(status=0)
/**
* true全部数据 false有效数据(status=0)
*/
private Boolean isAll=false;
//显示级别0全部 1一级 2二级 3三级
/**
* 显示级别0全部 1一级 2二级 3三级
*/
private Integer showLevel=0;
}

View File

@ -40,7 +40,7 @@ public class BaseEntity extends PageQuery {
/* --------------- 业务状态控制字段 --------------- */
/**
* 数据状态1=禁用0=启用
* 数据状态0=禁用1=启用
*/
@TableField(fill = FieldFill.INSERT)
private Integer status = 0;

57437
script/db/mms.pdma Normal file

File diff suppressed because one or more lines are too long