完善生产查询与登录权限配置

This commit is contained in:
2026-09-03 19:56:19 +08:00
parent 793f140a45
commit 02c8fb7021
438 changed files with 1595 additions and 573 deletions
@@ -0,0 +1,21 @@
/**
* 去除字符串空格
* @param str 输入字符串
* @param pos 去除位置,'both' | 'left' | 'right' | 'all',默认'both'
* @returns 去除空格后的字符串
*/
function trim(str: string, pos: 'both' | 'left' | 'right' | 'all' = 'both'): string {
if (pos === 'both') {
return str.replace(/^\s+|\s+$/g, '');
} else if (pos === 'left') {
return str.replace(/^\s*/, '');
} else if (pos === 'right') {
return str.replace(/(\s*$)/g, '');
} else if (pos === 'all') {
return str.replace(/\s+/g, '');
} else {
return str;
}
}
export default trim;