wangliang 4 lat temu
rodzic
commit
758c15d67c

+ 7 - 2
themis-admin/src/main/java/com/qmth/themis/admin/api/TBUserController.java

@@ -677,8 +677,13 @@ public class TBUserController {
                 String errorColumn = e.getCause().toString();
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length())
                         .replaceAll("'", "");
-                throw new BusinessException(
-                        "机构id[" + orgId + "]下的" + FieldUniqueEnum.convertToCode(columnStr) + "数据不允许重复插入");
+                if (Objects.nonNull(columnStr) && columnStr.contains("#23000")) {
+                    throw new BusinessException(
+                            "机构id[" + orgId + "]下的" + FieldUniqueEnum.org_login_name.getCode() + "数据不允许重复插入");
+                } else {
+                    throw new BusinessException(
+                            "机构id[" + orgId + "]下的" + FieldUniqueEnum.convertToCode(columnStr) + "数据不允许重复插入");
+                }
             } else if (e instanceof BusinessException) {
                 throw new BusinessException(e.getMessage());
             } else {