mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-10-17 23:43:43 +08:00
update 全局替换为 Convert.toStr,优化 null 字符串处理
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.dromara.common.excel.core;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -65,7 +66,7 @@ public class DropDownOptions {
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
String regex = "^[\\S\\d\\u4e00-\\u9fa5]+$";
|
||||
for (int i = 0; i < vars.length; i++) {
|
||||
String var = StrUtil.trimToEmpty(String.valueOf(vars[i]));
|
||||
String var = StrUtil.trimToEmpty(Convert.toStr(vars[i]));
|
||||
if (!var.matches(regex)) {
|
||||
throw new ServiceException("选项数据不符合规则,仅允许使用中英文字符以及数字");
|
||||
}
|
||||
|
Reference in New Issue
Block a user