From ce072993ccc72be00e05140f27c66ed01ffcc587 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期三, 19 十一月 2025 14:47:11 +0800
Subject: [PATCH] 工程师级别分为EE和PE

---
 SourceCode/Bond/Servo/CUserManager2.cpp |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/SourceCode/Bond/Servo/CUserManager2.cpp b/SourceCode/Bond/Servo/CUserManager2.cpp
index 4f45e52..aca0291 100644
--- a/SourceCode/Bond/Servo/CUserManager2.cpp
+++ b/SourceCode/Bond/Servo/CUserManager2.cpp
@@ -4,6 +4,7 @@
 #include <vector>
 #include <map>
 #include <utility>
+#include <algorithm>
 #include <sstream>
 #include <cwchar>
 
@@ -66,7 +67,7 @@
 	bool hasAny = false;
 	for (auto& ln : SplitLines(buffer)) { if (!ln.empty()) { hasAny = true; break; } }
 	if (!hasAny) {
-		const wchar_t* roles = L"Admin:100\nEngineer:50\nOperator:10\n";
+		const wchar_t* roles = L"Admin:100\nEE:80\nPE:50\nOperator:10\n";
 		(void)UX_SetRoleDefinitions(roles);
 		(void)UX_AddUser(L"admin", L"Administrator", L"admin123", L"Admin");
 
@@ -146,9 +147,15 @@
 		}
 	}
 
+	std::sort(roles.begin(), roles.end(), [](const RoleInfo& a, const RoleInfo& b) {
+		if (a.level == b.level) {
+			return a.name < b.name;
+		}
+		return a.level > b.level;
+	});
+
 	return roles;
 }
-
 std::vector<CUserManager2::UserInfo> CUserManager2::getUsers()
 {
 	std::vector<UserInfo> users;

--
Gitblit v1.9.3