From 03ffdd67fc4c40f3e9443931a0aa55e508182873 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期三, 06 八月 2025 17:00:06 +0800
Subject: [PATCH] feat: 字典

---
 src/utils/common/common.ts |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/utils/common/common.ts b/src/utils/common/common.ts
index b05dfc3..374c3a8 100644
--- a/src/utils/common/common.ts
+++ b/src/utils/common/common.ts
@@ -106,3 +106,12 @@
 export function filterNumbersFromString(str: string) {
   return str.replace(/\D/g, '');
 }
+
+export function formatRoleName(roleName: string) {
+  let lastUnderscoreIndex = roleName.lastIndexOf('_');
+
+  if (lastUnderscoreIndex !== -1) {
+    roleName = roleName.substring(0, lastUnderscoreIndex);
+  }
+  return roleName;
+}

--
Gitblit v1.9.1