类 DataUtil
java.lang.Object
com.sh.wf.module.util.DataUtil
Description:
Title:首亨软件 - TSS/CRM等
- 从以下版本开始:
- 2015年3月18日
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static StringappendCssClass(String str, String clazz) 追加CSS的样式static booleanatLeatOneNotEmpty(String... args) 判断至少有一个非空的参数static String自动提示时间格式表达式static intcalWidthByStr(ModuleContext context, String str) 计算字符串占用的页面宽度static String清除html代码中的Javascript代码static String过滤关键字,一般是变量名的问题static StringcheckAndResetFuncNameVariable(String funcName) 判断函数变量名,只能是字母、数字、-、_static StringcheckAndResetNormalVariable(String funcName) static StringcheckAndSetSortType(String sortType) 检查sort的有效性static String[]判断并分离排序列static StringcheckAttrSaveLine(String attr) static StringcheckAttrValue(String attr) static StringcheckAttrValue(String attr, String defaultValue) 表达式在进行解析前先调用的方法static Stringstatic voidcheckComponetAttrMapLanguage(ModuleContext context, Map<String, String> attrMap) static StringcheckESColumn(DsInfo dsInfo, String column) 检查es列名合法性,因为有 _source_开头的前缀static String[]checkFormValueValid(ModuleContext context, Map<String, String> attrMap, Component component, String paramName) 检查表单是否合法static String检查html 的a标签的hrefstatic Stringstatic StringcheckHtmlAttr(String str) 转换str到html的属性字符串,主要是防止xss漏洞static StringcheckHtmlAttr_full(String str) static booleancheckIsNormalVar(String str) 判断是否是基本变量,只能包含:数字、字母、下划线、中划线static booleancheckIsNormalVar(String str, boolean defaultValue) static booleancheckIsSqlInjection(ModuleContext context, String str) 判断该值是否为SQL注入的参数值static Stringstatic boolean判断是否是有效的表列static void检查是否包含宋体static StringcheckKeyword(String str) 特殊符号转义字符static StringcheckPagePx(String str) 检查页面长度大位static booleancheckReferer(ModuleContext context) 检查Referer的合法性static String检查URL路径,并转化为内网路径static String检查资源服务嚣路径,并转化为外网路径static String处理动态生成的脚本中的单引号属性,换行符会转化为空格static String处理动态生成的脚本中的单引号属性static String处理动态生成的脚本中的双引号属性,换行符转化为空格static String处理动态生成的脚本中的双引号属性static StringcheckXSSHtmlString(String value) 检查并转换XSS字符串,防止跨站脚本static StringcheckXSSJavaScriptString(String value) static StringcheckXSSSqlString(String value) 已过时。static Object克隆对象static voidcloseDataCenter(ModuleContext context) 关闭数据库连接static booleancontainValue(String[] array, String key) static StringconverInt2ColorStr(String s, String defaultColor) 将10进制的颜色值转化为16进制的颜色值static StringconverInt2ColorStr(String s, String defaultColor, int color) 将10进制的颜色值转化为16进制的颜色值static doubleconvert2Double(Object obj, double defaultValue) static String将字符串转换为HTML的属性值,主要是去掉引号特殊字符static intconvert2Int(Object obj, int defaultValue) static Stringconvert2JsonStr(String str) 将字符串转化为json要求的字符串static voidconvertBaiduMapGeoConv(Datastore ds, String provider, String lngCol, String latCol, String newLngCol, String newLatCol) 将其他坐标系转换为百度坐标系static StringconvertColor2Hex(Color color) 将Color对象转化为16进制值static intconvertColorStr2Int(String colorStr, int defaultValue) 将16进制颜色字符串转化为16进制整数值static StringconvertFilseSizeStr(double size) 将文件大小进行转换static StringconvertLocalHttpImg(jakarta.servlet.http.HttpServletRequest request, String path) static String[]convertMapProvider(String provider, String aimProvider, String lat, String lng) static StringconvertShowType(String showType, String value) 转化显示方式static booleanconvertString2Boolean(String str, boolean defaultValue) static StringconvertString2Default(String str, String defaultValue) 如果将字符串为空或null时转化为默认值static doubleconvertString2Double(String str, double defaultValue) static intconvertString2Int(String str, int defaultValue) static longconvertString2Long(String str, long defaultValue) static NumberconvertString2Number(String str, Number defaultValue) static shortconvertString2Short(String str, short defaultValue) static voidcopyClasspathFile(String classpathFilePath, String dimPath) 将资源路class路径下的文件复制到 指定目录static FilecopyFile(InputStream sourceInputStream, String aimFilePath) 拷贝文件,将文件从sourceFilePath 拷贝至aimFilePathstatic StringdecodeRequestParamValue(String paramValue) 对REQUEST中接收的参数进行解码static StringencodeJsStr(String str) 对参数变量进行加密,加密后在页面通过 module.decode(str)来进行解密static StringencodeUrlFull(String url) 将URL中的所有中文进行编码static StringencodeUrlParam(String paramValue) 转化URL变量值static booleanendsWithIgnoreCase(String str, String end) 不区分大小写判断是否以指定字符串结尾static ComponentfindParentComponent(Component component, String type) 通过类型查找父级组件static String格式化xmlstatic StringgenerateNavigateSelectPageRows(int pageRows) 生成页面分页标签可选择的每页记录数static org.apache.poi.ss.usermodel.CellStylegetCellStyle(ModuleContext context, org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell, Td td) 设置普通单元格样式static org.apache.poi.ss.usermodel.CellStylegetCellStyle(org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell) static org.apache.poi.ss.usermodel.CellStylegetCellStyle(org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell, Td td) 设置普通单元格样式static intgetCharCount(String str, char c) 获取字符串中的字符个数static StringgetClientIP(jakarta.servlet.http.HttpServletRequest request) 获取访问客户端的IPstatic doublegetCosineSimilarity(String text1, String text2) 获得两个句子的相似度 TF-IDF与余弦相似性 适合于短文本计算相似性 https://blog.csdn.net/egg1996911/article/details/81774456 http://www.ruanyifeng.com/blog/2013/03/cosine_similarity.htmlstatic DataCentergetDataCenter(String dcType) 根据数据类型获取连接 ,不会为Nullstatic DataCentergetDataCenterByDcType(String dcType) 通过dc获取数据,可能为nullstatic StringgetDBDate(DataCenter dc, String format) 获取数据库时间static Timestamp获取数据库时间static String根据传入的值自动获取Datastore数据类型static StringgetExportHtmlText(String html) 获取HTML代码中的文本值static byte[]getFileByte(String src) 获取图片二进制文件static org.apache.poi.ss.usermodel.CellStylegetHeaderCellStyle(ModuleContext context, org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell) 设置表头样式static org.apache.poi.ss.usermodel.CellStylegetHeaderCellStyle(org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell) 设置表头样式static StringgetHtmlText(String html) 获取HTML代码中的文本值static StringgetIconByMimeType(ModuleContext context, String mimeType, String src, boolean mtShowPic, boolean inRes) 根据文件类型获取显示的图标路径getImageTag(String html) 获取图片标签的URLstatic intgetJSONIntValue(JSONObject obj, String key, int defaultValue) static StringgetJSONStringValue(JSONObject obj, String key) static StringgetJSONStringValue(JSONObject obj, String key, String defaultValue) static StringgetLayuiButtonIconColor(String buttonStyle) 根据样式获取图标的颜色static StringgetLayuiButtonIconColorOnly(String buttonStyle) 根据样式获取图标的颜色static StringgetLayuiButtonSize(String sizeClass) 由于layui2.2.0后的版本对这个样式有调整,所以这里自动转化static org.apache.poi.ss.usermodel.CellStylegetLinkCellStyle(ModuleContext context, org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell) static org.apache.poi.ss.usermodel.CellStylegetLinkCellStyle(ModuleContext context, org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell, Td td) 设置超链接样式static StringgetLoadFuncName(ModuleContext context, String paramName) 获取异步调用的方法名参数,因为对于第一次加载的时候,需要从request.getAttribute中获取static int获取页面能获取到的最大页数static StringgetPageColor(String colorValue) 将16进制颜色值转为页面可识别#开头的颜色值static StringgetRequestValue(jakarta.servlet.http.HttpServletRequest request, String paramName) static StringgetRequestValue(jakarta.servlet.http.HttpServletRequest request, String paramName, boolean isEncode) 获取HttpServletRequest中的值,已进行了转码static String[]getRequestValues(ModuleContext context, String paramName) static StringgetResBaseUrl(jakarta.servlet.http.HttpServletRequest request) static String获取资源服务器转化为的URLstatic doublegetSimHashSimilarity(String text1, String text2) 获取两字符串的匹配度,目前 使用HanLP分词实现static DatastoregetStoreContextDs(ModuleContext context, String sql, String[] colsType, Object[] obj) static boolean判断是否为double类型static booleanisDsName(ModuleContext context, String dsName) 判断是否ds名称static booleanisFileNameValid(String name) 判断文件是否有效static booleanisFilePathValid(String path) 判断文件路径是否合法static booleanisHttpImageTrue(String source) 判断网络图片是否有效static booleanisJsContentContainAwait(String content) 判断JS内容中是否包含 await 关键字static booleanisJSONArrayValid(String str) static booleanisJSONObjectValid(String str) static booleanisJSONValid(String str) 判断是否有效的JSON字符串static booleanisMobileHttp(String userAgent) 检测是否是移动设备访问static booleanisObjectEqual(Object obj1, Object obj2) 安全、通用的对象相等判断方法,支持 String / Number / Date / BigDecimal / Timestamp 等static booleanisValidParamName(String str) 判断是否有效的变量名static booleanisValidToken(ModuleContext context, String token) static booleanisValidToken(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, UserInfo userInfo, String token) static voidparserContextRequestValue(ModuleContext context) static StringprocessRequestParam(ModuleContext context, String obj, String hasStr) 将request中的参数进行传递static voidrefreshUser(DataCenter dc, String userId, boolean updatePwd) 刷新用户信息,修改用户信息后操作static String删除失败行符、水平制表符static voidremoveSessionByKey(jakarta.servlet.http.HttpSession session, String startKey) 删除以指定字符串开头的session值static StringreplaceWhereCondition(DataCenter dc, String sql, String where) 替换掉SQL条件static StringrestoreCheckXSSHtmlString(String value) static booleansendResponseAIAgentSSE(ModuleContext context, JSONObject data) static voidsendResponseAIAgentSSE(ModuleContext context, String text) 响应SSE消息static voidsendResponseAIAgentSSEError(ModuleContext context, String text) static voidstoreContextDs(ModuleContext context, Datastore ds, String sql, String[] colsType, Object[] obj) static StringstoreContextDsKey(String sql, String[] colsType, Object[] obj) static StringtimeAgo(int sec) 某个时间在当前时间的多久前static StringtoContextRequestValue(ModuleContext context, String objName) static StringtoResInnerUrl(String url) static String将URL转换为资源服务器路径static String
-
构造器详细资料
-
DataUtil
public DataUtil()
-
-
方法详细资料
-
refreshUser
刷新用户信息,修改用户信息后操作- 参数:
dc- DataCenteruserId- StringupdatePwd- 是否修改了密码,修改了密码会触发修改密码的事件
-
convertMapProvider
public static String[] convertMapProvider(String provider, String aimProvider, String lat, String lng) - 参数:
provider- 坐标系 wgs84/gcj02/bd09provider- StringaimProvider- Stringlat- Stringlng- String- 返回:
- [lat,lng]
-
getHtmlText
获取HTML代码中的文本值- 参数:
html- String- 返回:
- String
-
getExportHtmlText
获取HTML代码中的文本值- 参数:
html- String- 返回:
- String
-
getImageTag
获取图片标签的URL- 参数:
html-- 返回:
-
checkResUrlAndReturnWWWUrl
检查资源服务嚣路径,并转化为外网路径- 参数:
path- String- 返回:
- String
-
checkResUrlAndReturnInnerUrl
检查URL路径,并转化为内网路径- 参数:
path- String- 返回:
- String
-
converInt2ColorStr
将10进制的颜色值转化为16进制的颜色值- 参数:
s- StringdefaultColor- String- 返回:
- String
-
converInt2ColorStr
将10进制的颜色值转化为16进制的颜色值- 参数:
s- StringdefaultColor- Stringcolor- 忽略颜色- 返回:
- String
-
convertColorStr2Int
将16进制颜色字符串转化为16进制整数值- 参数:
colorStr- StringdefaultValue- int- 返回:
- int
-
convertColor2Hex
将Color对象转化为16进制值- 参数:
color-- 返回:
-
getPageColor
将16进制颜色值转为页面可识别#开头的颜色值- 参数:
colorValue- 颜色值- 返回:
- String
-
convertString2Default
如果将字符串为空或null时转化为默认值- 参数:
str- StringdefaultValue- String- 返回:
- String
-
getJSONStringValue
-
getJSONStringValue
-
getJSONIntValue
-
convertString2Boolean
-
convertString2Double
-
convert2Double
-
convertString2Short
-
convertString2Number
-
convertString2Int
-
convert2Int
-
convertString2Long
-
toContextRequestValue
-
parserContextRequestValue
-
convert2HtmlKeyword
将字符串转换为HTML的属性值,主要是去掉引号特殊字符- 参数:
str- String- 返回:
- String
-
getLinkCellStyle
public static org.apache.poi.ss.usermodel.CellStyle getLinkCellStyle(ModuleContext context, org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell, Td td) 设置超链接样式- 参数:
context- ModuleContextbook- Workbookcell- Celltd- Td- 返回:
- CellStyle
-
getLinkCellStyle
public static org.apache.poi.ss.usermodel.CellStyle getLinkCellStyle(ModuleContext context, org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell) -
getHeaderCellStyle
public static org.apache.poi.ss.usermodel.CellStyle getHeaderCellStyle(org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell) 设置表头样式- 参数:
book- Workbookcell- Cell- 返回:
- CellStyle
-
getHeaderCellStyle
public static org.apache.poi.ss.usermodel.CellStyle getHeaderCellStyle(ModuleContext context, org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell) 设置表头样式- 参数:
context- ModuleContextbook- Workbookcell- Cell- 返回:
- CellStyle
-
getCellStyle
public static org.apache.poi.ss.usermodel.CellStyle getCellStyle(org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell, Td td) 设置普通单元格样式- 参数:
book- Workbookcell- Celltd- Td- 返回:
- CellStyle
-
getCellStyle
public static org.apache.poi.ss.usermodel.CellStyle getCellStyle(ModuleContext context, org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell, Td td) 设置普通单元格样式- 参数:
context- ModuleContextbook- Workbookcell- Celltd- Td- 返回:
- CellStyle
-
getCellStyle
public static org.apache.poi.ss.usermodel.CellStyle getCellStyle(org.apache.poi.ss.usermodel.Workbook book, org.apache.poi.ss.usermodel.Cell cell) -
processRequestParam
将request中的参数进行传递- 参数:
context- ModuleContextobj- StringhasStr- String- 返回:
- String
-
isValidParamName
判断是否有效的变量名- 参数:
str-- 返回:
-
decodeRequestParamValue
对REQUEST中接收的参数进行解码- 参数:
paramValue- String- 返回:
- String
-
encodeUrlParam
转化URL变量值- 参数:
paramValue- String- 返回:
- String
-
encodeUrlFull
将URL中的所有中文进行编码- 参数:
url-- 返回:
-
encodeJsStr
对参数变量进行加密,加密后在页面通过 module.decode(str)来进行解密- 参数:
str-- 返回:
- 简单加密
-
getRequestValue
-
getRequestValue
public static String getRequestValue(jakarta.servlet.http.HttpServletRequest request, String paramName, boolean isEncode) 获取HttpServletRequest中的值,已进行了转码- 参数:
request- HttpServletRequestparamName- StringisEncode- boolean- 返回:
- String
-
getRequestValues
-
findParentComponent
通过类型查找父级组件- 参数:
component- Componenttype- String- 返回:
- Component
-
convertShowType
转化显示方式- 参数:
showType- Stringvalue- String- 返回:
- String
-
getLoadFuncName
获取异步调用的方法名参数,因为对于第一次加载的时候,需要从request.getAttribute中获取- 参数:
context- ModuleContextparamName- String- 返回:
- String
-
removeSessionByKey
删除以指定字符串开头的session值- 参数:
session- HttpSessionstartKey- String
-
getFileByte
获取图片二进制文件- 参数:
src- String- 返回:
- byte[]
-
checkAttrSaveLine
-
checkAttrValue
-
checkAttrValue
表达式在进行解析前先调用的方法- 参数:
attr- StringdefaultValue- String- 返回:
- String
-
checkAttrValue_reversal
-
checkKeyword
特殊符号转义字符- 参数:
str- String- 返回:
- String
-
isDsName
判断是否ds名称- 参数:
context- ModuleContextdsName- String- 返回:
- boolean
-
getIconByMimeType
public static String getIconByMimeType(ModuleContext context, String mimeType, String src, boolean mtShowPic, boolean inRes) 根据文件类型获取显示的图标路径- 参数:
context- 模块上下文mimeType- 文件类型src- 图片地址mtShowPic- 如果为图片时是否直接显示图片inRes- 图片是否保存在资源服务器上- 返回:
- String
-
isDouble
判断是否为double类型- 参数:
str- String- 返回:
- boolean
-
checkScriptAttrStrYinghao
处理动态生成的脚本中的双引号属性,换行符转化为空格- 参数:
str- String- 返回:
- String
-
removeEnterCharacter
删除失败行符、水平制表符- 参数:
str-- 返回:
-
convertLocalHttpImg
-
checkScriptAttrStrYinghaoHtml
处理动态生成的脚本中的双引号属性- 参数:
str- String- 返回:
- String
-
checkScriptAttrStrDanYinghao
处理动态生成的脚本中的单引号属性,换行符会转化为空格- 参数:
str- String- 返回:
- String
-
checkScriptAttrStrDanYinghaoHtml
处理动态生成的脚本中的单引号属性- 参数:
str- String- 返回:
- String
-
checkHtml_attr_Yinghao
-
checkHtml_attr_href_yinghao
检查html 的a标签的href- 参数:
str- String- 返回:
- String
-
checkHtmlAttr
转换str到html的属性字符串,主要是防止xss漏洞- 参数:
str- String- 返回:
- String
-
checkHtmlAttr_full
-
isMobileHttp
检测是否是移动设备访问- 参数:
userAgent- 浏览器标识- 返回:
- true:移动设备接入,false:pc端接入
-
getResUrl
获取资源服务器转化为的URL- 参数:
request- HttpServletRequesturl- String- 返回:
- String
-
getResBaseUrl
-
containValue
-
isHttpImageTrue
判断网络图片是否有效- 参数:
source- String- 返回:
- boolean
-
convert2JsonStr
将字符串转化为json要求的字符串- 参数:
str- String- 返回:
- String
-
cloneObj
克隆对象- 参数:
sourceObj- Object- 返回:
- Object
-
getDBDate
获取数据库时间- 参数:
dc- DataCenterformat- String- 返回:
- String
-
getDBTimestamp
获取数据库时间- 参数:
dc- DataCenter- 返回:
- Timestamp
-
getDataCenter
根据数据类型获取连接 ,不会为Null- 参数:
dcType- String- 返回:
- DataCenter
-
getDataCenterByDcType
通过dc获取数据,可能为null- 参数:
dcType-- 返回:
-
closeDataCenter
关闭数据库连接- 参数:
context- ModuleContext
-
convertBaiduMapGeoConv
public static void convertBaiduMapGeoConv(Datastore ds, String provider, String lngCol, String latCol, String newLngCol, String newLatCol) 将其他坐标系转换为百度坐标系- 参数:
ds- Datastoreprovider- StringlngCol- StringlatCol- StringnewLngCol- StringnewLatCol- String
-
checkIsSQLInlineQuery
-
checkAndSplitOrderby
判断并分离排序列- 参数:
sql- String- 返回:
- String
-
isValidToken
-
isValidToken
-
convertFilseSizeStr
将文件大小进行转换- 参数:
size- 文件大小 单位:字节- 返回:
- 如:1024 转化为1kb
-
timeAgo
某个时间在当前时间的多久前- 参数:
sec- 秒- 返回:
- 多久前
-
checkJVMFont_simsun
public static void checkJVMFont_simsun()检查是否包含宋体 -
copyClasspathFile
将资源路class路径下的文件复制到 指定目录- 参数:
classpathFilePath- StringdimPath- String
-
copyFile
拷贝文件,将文件从sourceFilePath 拷贝至aimFilePath- 参数:
sourceInputStream- 文件流aimFilePath- 目的文件地址 如:D:/AIM/test.txt- 返回:
- File
- 抛出:
Exception- Exception
-
formatXml
格式化xml- 参数:
xml- String- 返回:
- String
-
getLayuiButtonIconColor
根据样式获取图标的颜色- 参数:
buttonStyle- String- 返回:
- String
-
getLayuiButtonIconColorOnly
根据样式获取图标的颜色- 参数:
buttonStyle- String- 返回:
- String
-
getLayuiButtonSize
由于layui2.2.0后的版本对这个样式有调整,所以这里自动转化- 参数:
sizeClass- String- 返回:
- String
-
checkXSSHtmlString
检查并转换XSS字符串,防止跨站脚本- 参数:
value- String- 返回:
- String
-
restoreCheckXSSHtmlString
-
checkXSSJavaScriptString
-
checkXSSSqlString
已过时。 -
atLeatOneNotEmpty
判断至少有一个非空的参数- 参数:
args-- 返回:
-
checkIsNormalVar
判断是否是基本变量,只能包含:数字、字母、下划线、中划线- 参数:
str- String- 返回:
- boolean
-
checkIsNormalVar
-
checkIsValidTableCol
判断是否是有效的表列- 参数:
str- String- 返回:
- boolean
-
getCharCount
获取字符串中的字符个数- 参数:
str- Stringc- char- 返回:
- int
-
getSimHashSimilarity
获取两字符串的匹配度,目前 使用HanLP分词实现- 参数:
text1- Stringtext2- String- 返回:
- double
-
getCosineSimilarity
获得两个句子的相似度 TF-IDF与余弦相似性 适合于短文本计算相似性 https://blog.csdn.net/egg1996911/article/details/81774456 http://www.ruanyifeng.com/blog/2013/03/cosine_similarity.html- 参数:
text1- Stringtext2- String- 返回:
- double
-
checkESColumn
检查es列名合法性,因为有 _source_开头的前缀- 参数:
dsInfo- DsInfocolumn- String- 返回:
- String
-
checkAndSetSortType
检查sort的有效性- 参数:
sortType- String- 返回:
- String
-
replaceWhereCondition
替换掉SQL条件- 参数:
dc- 数据连接sql- SQL语句where- 替换查询条件- 返回:
- String
-
storeContextDsKey
-
storeContextDs
public static void storeContextDs(ModuleContext context, Datastore ds, String sql, String[] colsType, Object[] obj) -
getStoreContextDs
public static Datastore getStoreContextDs(ModuleContext context, String sql, String[] colsType, Object[] obj) -
checkFormValueValid
public static String[] checkFormValueValid(ModuleContext context, Map<String, String> attrMap, Component component, String paramName) 检查表单是否合法- 参数:
context- ModuleContextattrMap- Mapcomponent- ComponentparamName- String- 返回:
- String[]
-
isJSONValid
判断是否有效的JSON字符串- 参数:
str- String- 返回:
- boolean
-
isJSONObjectValid
-
isJSONArrayValid
-
checkAndConvertNormalVariable
过滤关键字,一般是变量名的问题- 参数:
str-- 返回:
-
checkAndResetFuncNameVariable
判断函数变量名,只能是字母、数字、-、_- 参数:
funcName-- 返回:
-
checkAndResetNormalVariable
-
checkAndClearHtmlJavascript
清除html代码中的Javascript代码- 参数:
html-- 返回:
-
toResUrl
-
toResUrl
将URL转换为资源服务器路径- 参数:
request-url-- 返回:
-
toResInnerUrl
-
getClientIP
获取访问客户端的IP- 参数:
request- HttpServletRequest- 返回:
- String
-
isJsContentContainAwait
判断JS内容中是否包含 await 关键字- 参数:
content-- 返回:
-
checkComponetAttrMapLanguage
-
isFileNameValid
判断文件是否有效- 参数:
name-- 返回:
-
isFilePathValid
判断文件路径是否合法- 参数:
path-- 返回:
-
checkReferer
检查Referer的合法性- 参数:
context-- 返回:
-
getDsColTypeByObjectValue
根据传入的值自动获取Datastore数据类型- 参数:
obj-- 返回:
-
calWidthByStr
计算字符串占用的页面宽度- 参数:
context-str-- 返回:
-
endsWithIgnoreCase
不区分大小写判断是否以指定字符串结尾- 参数:
str-end-- 返回:
-
checkIsSqlInjection
判断该值是否为SQL注入的参数值- 参数:
context-str-- 返回:
-
appendCssClass
追加CSS的样式- 参数:
str-clazz-- 返回:
-
autoParseTimePattern
自动提示时间格式表达式- 参数:
str-- 返回:
-
sendResponseAIAgentSSE
响应SSE消息- 参数:
context-data-
-
sendResponseAIAgentSSEError
-
sendResponseAIAgentSSE
-
isObjectEqual
安全、通用的对象相等判断方法,支持 String / Number / Date / BigDecimal / Timestamp 等 -
checkPagePx
检查页面长度大位- 参数:
str-- 返回:
-