update 修改失效配置
parent
a460a23149
commit
5aa45e7a92
|
|
@ -27,11 +27,13 @@ dubbo:
|
||||||
address: nacos://${spring.cloud.nacos.server-addr}
|
address: nacos://${spring.cloud.nacos.server-addr}
|
||||||
group: DUBBO_GROUP
|
group: DUBBO_GROUP
|
||||||
consumer:
|
consumer:
|
||||||
|
cache: true
|
||||||
|
validation: true
|
||||||
|
timeout: 3000
|
||||||
check: false
|
check: false
|
||||||
scan:
|
scan:
|
||||||
base-packages: com.ruoyi
|
base-packages: com.ruoyi.**.dubbo
|
||||||
cloud:
|
cloud:
|
||||||
# 规避警告 无其他作用 后续升级3.X删除
|
|
||||||
subscribed-services: ${dubbo.application.name}
|
subscribed-services: ${dubbo.application.name}
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
|
|
@ -124,25 +126,6 @@ security:
|
||||||
- /*/v2/api-docs
|
- /*/v2/api-docs
|
||||||
- /csrf
|
- /csrf
|
||||||
|
|
||||||
# feign 配置
|
|
||||||
feign:
|
|
||||||
sentinel:
|
|
||||||
enabled: true
|
|
||||||
okhttp:
|
|
||||||
enabled: true
|
|
||||||
httpclient:
|
|
||||||
enabled: false
|
|
||||||
client:
|
|
||||||
config:
|
|
||||||
default:
|
|
||||||
connectTimeout: 10000
|
|
||||||
readTimeout: 10000
|
|
||||||
compression:
|
|
||||||
request:
|
|
||||||
enabled: true
|
|
||||||
response:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
# 暴露监控端点
|
# 暴露监控端点
|
||||||
management:
|
management:
|
||||||
endpoints:
|
endpoints:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.ruoyi.gateway.filter;
|
package com.ruoyi.gateway.filter;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.ruoyi.common.core.utils.JsonUtils;
|
||||||
import com.ruoyi.common.core.utils.ServletUtils;
|
import com.ruoyi.common.core.utils.ServletUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.gateway.config.properties.CaptchaProperties;
|
import com.ruoyi.gateway.config.properties.CaptchaProperties;
|
||||||
|
|
@ -16,6 +16,7 @@ import reactor.core.publisher.Flux;
|
||||||
|
|
||||||
import java.nio.CharBuffer;
|
import java.nio.CharBuffer;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -49,8 +50,8 @@ public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object> {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String rspStr = resolveBodyFromRequest(request);
|
String rspStr = resolveBodyFromRequest(request);
|
||||||
JSONObject obj = JSONObject.parseObject(rspStr);
|
Map<String, String> obj = JsonUtils.parseMap(rspStr);
|
||||||
validateCodeService.checkCapcha(obj.getString(CODE), obj.getString(UUID));
|
validateCodeService.checkCapcha(obj.get(CODE), obj.get(UUID));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return ServletUtils.webFluxResponseWriter(exchange.getResponse(), e.getMessage());
|
return ServletUtils.webFluxResponseWriter(exchange.getResponse(), e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
package com.ruoyi.gen.service;
|
package com.ruoyi.gen.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.ruoyi.common.core.constant.Constants;
|
import com.ruoyi.common.core.constant.Constants;
|
||||||
import com.ruoyi.common.core.constant.GenConstants;
|
import com.ruoyi.common.core.constant.GenConstants;
|
||||||
import com.ruoyi.common.core.exception.ServiceException;
|
import com.ruoyi.common.core.exception.ServiceException;
|
||||||
|
import com.ruoyi.common.core.utils.JsonUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
import com.ruoyi.gen.domain.GenTable;
|
import com.ruoyi.gen.domain.GenTable;
|
||||||
|
|
@ -115,7 +114,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateGenTable(GenTable genTable) {
|
public void updateGenTable(GenTable genTable) {
|
||||||
String options = JSON.toJSONString(genTable.getParams());
|
String options = JsonUtils.toJsonString(genTable.getParams());
|
||||||
genTable.setOptions(options);
|
genTable.setOptions(options);
|
||||||
int row = genTableMapper.updateGenTable(genTable);
|
int row = genTableMapper.updateGenTable(genTable);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
|
|
@ -339,13 +338,13 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
@Override
|
@Override
|
||||||
public void validateEdit(GenTable genTable) {
|
public void validateEdit(GenTable genTable) {
|
||||||
if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) {
|
if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) {
|
||||||
String options = JSON.toJSONString(genTable.getParams());
|
String options = JsonUtils.toJsonString(genTable.getParams());
|
||||||
JSONObject paramsObj = JSONObject.parseObject(options);
|
Map<String, String> paramsObj = JsonUtils.parseMap(options);
|
||||||
if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) {
|
if (StringUtils.isEmpty(paramsObj.get(GenConstants.TREE_CODE))) {
|
||||||
throw new ServiceException("树编码字段不能为空");
|
throw new ServiceException("树编码字段不能为空");
|
||||||
} else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) {
|
} else if (StringUtils.isEmpty(paramsObj.get(GenConstants.TREE_PARENT_CODE))) {
|
||||||
throw new ServiceException("树父编码字段不能为空");
|
throw new ServiceException("树父编码字段不能为空");
|
||||||
} else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) {
|
} else if (StringUtils.isEmpty(paramsObj.get(GenConstants.TREE_NAME))) {
|
||||||
throw new ServiceException("树名称字段不能为空");
|
throw new ServiceException("树名称字段不能为空");
|
||||||
} else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) {
|
} else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) {
|
||||||
if (StringUtils.isEmpty(genTable.getSubTableName())) {
|
if (StringUtils.isEmpty(genTable.getSubTableName())) {
|
||||||
|
|
@ -403,13 +402,13 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||||
* @param genTable 设置后的生成对象
|
* @param genTable 设置后的生成对象
|
||||||
*/
|
*/
|
||||||
public void setTableFromOptions(GenTable genTable) {
|
public void setTableFromOptions(GenTable genTable) {
|
||||||
JSONObject paramsObj = JSONObject.parseObject(genTable.getOptions());
|
Map<String, String> paramsObj = JsonUtils.parseMap(genTable.getOptions());
|
||||||
if (StringUtils.isNotNull(paramsObj)) {
|
if (StringUtils.isNotNull(paramsObj)) {
|
||||||
String treeCode = paramsObj.getString(GenConstants.TREE_CODE);
|
String treeCode = paramsObj.get(GenConstants.TREE_CODE);
|
||||||
String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE);
|
String treeParentCode = paramsObj.get(GenConstants.TREE_PARENT_CODE);
|
||||||
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
|
String treeName = paramsObj.get(GenConstants.TREE_NAME);
|
||||||
String parentMenuId = paramsObj.getString(GenConstants.PARENT_MENU_ID);
|
String parentMenuId = paramsObj.get(GenConstants.PARENT_MENU_ID);
|
||||||
String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME);
|
String parentMenuName = paramsObj.get(GenConstants.PARENT_MENU_NAME);
|
||||||
|
|
||||||
genTable.setTreeCode(treeCode);
|
genTable.setTreeCode(treeCode);
|
||||||
genTable.setTreeParentCode(treeParentCode);
|
genTable.setTreeParentCode(treeParentCode);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,14 @@
|
||||||
package com.ruoyi.gen.util;
|
package com.ruoyi.gen.util;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.ruoyi.common.core.constant.GenConstants;
|
import com.ruoyi.common.core.constant.GenConstants;
|
||||||
import com.ruoyi.common.core.utils.DateUtils;
|
import com.ruoyi.common.core.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.core.utils.JsonUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.gen.domain.GenTable;
|
import com.ruoyi.gen.domain.GenTable;
|
||||||
import com.ruoyi.gen.domain.GenTableColumn;
|
import com.ruoyi.gen.domain.GenTableColumn;
|
||||||
import org.apache.velocity.VelocityContext;
|
import org.apache.velocity.VelocityContext;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模板工具类
|
* 模板工具类
|
||||||
|
|
@ -77,14 +74,14 @@ public class VelocityUtils {
|
||||||
|
|
||||||
public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) {
|
public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) {
|
||||||
String options = genTable.getOptions();
|
String options = genTable.getOptions();
|
||||||
JSONObject paramsObj = JSONObject.parseObject(options);
|
Map<String, String> paramsObj = JsonUtils.parseMap(options);
|
||||||
String parentMenuId = getParentMenuId(paramsObj);
|
String parentMenuId = getParentMenuId(paramsObj);
|
||||||
context.put("parentMenuId", parentMenuId);
|
context.put("parentMenuId", parentMenuId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) {
|
public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) {
|
||||||
String options = genTable.getOptions();
|
String options = genTable.getOptions();
|
||||||
JSONObject paramsObj = JSONObject.parseObject(options);
|
Map<String, String> paramsObj = JsonUtils.parseMap(options);
|
||||||
String treeCode = getTreecode(paramsObj);
|
String treeCode = getTreecode(paramsObj);
|
||||||
String treeParentCode = getTreeParentCode(paramsObj);
|
String treeParentCode = getTreeParentCode(paramsObj);
|
||||||
String treeName = getTreeName(paramsObj);
|
String treeName = getTreeName(paramsObj);
|
||||||
|
|
@ -94,10 +91,10 @@ public class VelocityUtils {
|
||||||
context.put("treeName", treeName);
|
context.put("treeName", treeName);
|
||||||
context.put("expandColumn", getExpandColumn(genTable));
|
context.put("expandColumn", getExpandColumn(genTable));
|
||||||
if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) {
|
if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) {
|
||||||
context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE));
|
context.put("tree_parent_code", paramsObj.get(GenConstants.TREE_PARENT_CODE));
|
||||||
}
|
}
|
||||||
if (paramsObj.containsKey(GenConstants.TREE_NAME)) {
|
if (paramsObj.containsKey(GenConstants.TREE_NAME)) {
|
||||||
context.put("tree_name", paramsObj.getString(GenConstants.TREE_NAME));
|
context.put("tree_name", paramsObj.get(GenConstants.TREE_NAME));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -261,10 +258,10 @@ public class VelocityUtils {
|
||||||
* @param paramsObj 生成其他选项
|
* @param paramsObj 生成其他选项
|
||||||
* @return 上级菜单ID字段
|
* @return 上级菜单ID字段
|
||||||
*/
|
*/
|
||||||
public static String getParentMenuId(JSONObject paramsObj) {
|
public static String getParentMenuId(Map<String, String> paramsObj) {
|
||||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)
|
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)
|
||||||
&& StringUtils.isNotEmpty(paramsObj.getString(GenConstants.PARENT_MENU_ID))) {
|
&& StringUtils.isNotEmpty(paramsObj.get(GenConstants.PARENT_MENU_ID))) {
|
||||||
return paramsObj.getString(GenConstants.PARENT_MENU_ID);
|
return paramsObj.get(GenConstants.PARENT_MENU_ID);
|
||||||
}
|
}
|
||||||
return DEFAULT_PARENT_MENU_ID;
|
return DEFAULT_PARENT_MENU_ID;
|
||||||
}
|
}
|
||||||
|
|
@ -275,9 +272,9 @@ public class VelocityUtils {
|
||||||
* @param paramsObj 生成其他选项
|
* @param paramsObj 生成其他选项
|
||||||
* @return 树编码
|
* @return 树编码
|
||||||
*/
|
*/
|
||||||
public static String getTreecode(JSONObject paramsObj) {
|
public static String getTreecode(Map<String, String> paramsObj) {
|
||||||
if (paramsObj.containsKey(GenConstants.TREE_CODE)) {
|
if (paramsObj.containsKey(GenConstants.TREE_CODE)) {
|
||||||
return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_CODE));
|
return StringUtils.toCamelCase(paramsObj.get(GenConstants.TREE_CODE));
|
||||||
}
|
}
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
@ -288,9 +285,9 @@ public class VelocityUtils {
|
||||||
* @param paramsObj 生成其他选项
|
* @param paramsObj 生成其他选项
|
||||||
* @return 树父编码
|
* @return 树父编码
|
||||||
*/
|
*/
|
||||||
public static String getTreeParentCode(JSONObject paramsObj) {
|
public static String getTreeParentCode(Map<String, String> paramsObj) {
|
||||||
if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) {
|
if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) {
|
||||||
return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_PARENT_CODE));
|
return StringUtils.toCamelCase(paramsObj.get(GenConstants.TREE_PARENT_CODE));
|
||||||
}
|
}
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
@ -301,9 +298,9 @@ public class VelocityUtils {
|
||||||
* @param paramsObj 生成其他选项
|
* @param paramsObj 生成其他选项
|
||||||
* @return 树名称
|
* @return 树名称
|
||||||
*/
|
*/
|
||||||
public static String getTreeName(JSONObject paramsObj) {
|
public static String getTreeName(Map<String, String> paramsObj) {
|
||||||
if (paramsObj.containsKey(GenConstants.TREE_NAME)) {
|
if (paramsObj.containsKey(GenConstants.TREE_NAME)) {
|
||||||
return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_NAME));
|
return StringUtils.toCamelCase(paramsObj.get(GenConstants.TREE_NAME));
|
||||||
}
|
}
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
@ -316,8 +313,8 @@ public class VelocityUtils {
|
||||||
*/
|
*/
|
||||||
public static int getExpandColumn(GenTable genTable) {
|
public static int getExpandColumn(GenTable genTable) {
|
||||||
String options = genTable.getOptions();
|
String options = genTable.getOptions();
|
||||||
JSONObject paramsObj = JSONObject.parseObject(options);
|
Map<String, String> paramsObj = JsonUtils.parseMap(options);
|
||||||
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
|
String treeName = paramsObj.get(GenConstants.TREE_NAME);
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (GenTableColumn column : genTable.getColumns()) {
|
for (GenTableColumn column : genTable.getColumns()) {
|
||||||
if (column.isList()) {
|
if (column.isList()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue