fix(bpm):缺少了subString 方法,应该是商城功能改subString这个工具类,不小心影响了bpm的功能

This commit is contained in:
徐煜东
2025-04-05 13:54:24 +08:00
parent e289d5c91b
commit 15d4fc2bd5

View File

@ -536,3 +536,18 @@ export const sliceName = (name: string, start: number, end: number) => {
}
return name
}
/**
* 截取字符串
*
* @param str 字符串
* @param start 开始位置
* @param end 结束位置
*/
export const subString = (str: string, start: number, end: number) => {
if (str.length > end) {
return str.slice(start, end)
}
return str
}