From fc8d367963a16de61dfbc4a0ff34c78c91ec2cfe Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 05 九月 2025 09:21:28 +0800
Subject: [PATCH] Merge branch 'liuyang' into clh

---
 SourceCode/Bond/Servo/ServoDlg.cpp |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index c1a4238..573a713 100644
--- a/SourceCode/Bond/Servo/ServoDlg.cpp
+++ b/SourceCode/Bond/Servo/ServoDlg.cpp
@@ -27,6 +27,7 @@
 #include "CPageReport.h"
 #include "CPageCollectionEvent.h"
 #include "CControlJobDlg.h"
+#include "InputDialog.h"
 
 
 #ifdef _DEBUG
@@ -956,6 +957,28 @@
 LRESULT CServoDlg::OnToolbarBtnClicked(WPARAM wParam, LPARAM lParam)
 {
 	int id = (int)lParam;
+	if (id == IDC_BUTTON_RUN || id == IDC_BUTTON_STOP) {
+		//CInputDialog inputDialog(_T("验证用户"), _T("请输入用户密码:"));
+		//if (inputDialog.DoModal() != IDOK) {
+		//	AfxMessageBox(_T("取消验证!"));
+		//	return 0;
+		//}
+	
+		//CString inputText = inputDialog.GetInputText();
+		//std::string strPass = UserManager::getInstance().getCurrentPass();
+		//if (inputText.Compare(strPass.c_str()) != 0) {
+		//	AfxMessageBox(_T("密码错误!"));
+		//	SystemLogManager::getInstance().log(SystemLogManager::LogType::Info, _T("验证时,密码错误!"));
+		//	return 0;
+		//}
+		
+		UserRole emRole = UserManager::getInstance().getCurrentUserRole();
+		if (emRole != UserRole::SuperAdmin) {
+			AfxMessageBox(_T("当前用户并非管理员!!!")); 
+			return 1;
+		}
+	}
+
 	if (id == IDC_BUTTON_RUN) {
 		if (theApp.m_model.getMaster().getState() == SERVO::MASTERSTATE::MSERROR) {
 			AfxMessageBox("当前有机台发生错误,不能启动,请确认解决问题后再尝试重新启动!");

--
Gitblit v1.9.3