Browse Source

权限管理

Linsk 3 months ago
parent
commit
1487e65f3b

+ 1 - 1
BLL/Dto/UserDto/QueryUserAuthDto.cs

@@ -4,7 +4,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace BLL.Dto
+namespace BLL.Dto.UserDto
 {
     public class QueryUserAuthDto
     {

+ 3 - 1
BLL/Manager/AuthManager.cs

@@ -6,12 +6,13 @@ using System.Threading.Tasks;
 using BLL.Dto.AuthDto;
 using DAL.Services;
 using Helper;
+using HZY.Framework.DependencyInjection;
 using Mapster;
 using Model;
 
 namespace BLL.Manager
 {
-    public class AuthManager
+    public class AuthManager:IScopedSelfDependency
     {
         private readonly AuthService _authService;
         public AuthManager(AuthService authService)
@@ -39,5 +40,6 @@ namespace BLL.Manager
             return new BaseResult<QueryAuthResultDto>() { Result = SystemEnums.Result.Success, Data = new List<QueryAuthResultDto>() { res.Adapt<QueryAuthResultDto>() } };
 
         }
+
     }
 }

+ 56 - 0
Scada/FormLogin.Designer.cs

@@ -0,0 +1,56 @@
+namespace Scada
+{
+    partial class FormLogin
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            SuspendLayout();
+            // 
+            // lblTitle
+            // 
+            lblTitle.Text = "SCADA喷涂工艺系统";
+            // 
+            // lblSubText
+            // 
+            lblSubText.Location = new Point(376, 421);
+            lblSubText.Text = "SCADA V1.0";
+            // 
+            // FormLogin
+            // 
+            AutoScaleMode = AutoScaleMode.None;
+            ClientSize = new Size(750, 450);
+            Name = "FormLogin";
+            SubText = "SCADA V1.0";
+            Text = "FormLogin";
+            Title = "SCADA喷涂工艺系统";
+            ButtonLoginClick += FormLogin_ButtonLoginClick;
+            ResumeLayout(false);
+        }
+
+        #endregion
+    }
+}

+ 42 - 0
Scada/FormLogin.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using BLL;
+using Helper;
+using HZY.Framework.DependencyInjection;
+using Sunny.UI;
+
+namespace Scada
+{
+    public partial class FormLogin : UILoginForm, IScopedSelfDependency
+    {
+        private readonly UserManager _userManager;
+        public FormLogin(UserManager userManager)
+        {
+            _userManager = userManager;
+            InitializeComponent();
+        }
+
+        private async Task FormLogin_ButtonLoginClick(object sender, EventArgs e)
+        {
+            var result = await _userManager.LoginAsync(new UserLoginDto() { UserName=this.UserName,UserPassword=this.Password});
+            
+            if(result.Result==SystemEnums.Result.Success)
+            {
+                IsLogin = true;
+                this.ShowSuccessTip("登录成功");
+                this.Close();
+            }
+            else
+            {
+                UIMessageTip.ShowWarning(result.Msg);
+            }
+        }
+    }
+}

+ 120 - 0
Scada/FormLogin.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!--
+    Microsoft ResX Schema
+
+    Version 2.0
+
+    The primary goals of this format is to allow a simple XML format
+    that is mostly human readable. The generation and parsing of the
+    various data types are done through the TypeConverter classes
+    associated with the data types.
+
+    Example:
+
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+
+    There are any number of "resheader" rows that contain simple
+    name/value pairs.
+
+    Each data row contains a name, and value. The row also contains a
+    type or mimetype. Type corresponds to a .NET class that support
+    text/value conversion through the TypeConverter architecture.
+    Classes that don't support this are serialized and stored with the
+    mimetype set.
+
+    The mimetype is used for serialized objects, and tells the
+    ResXResourceReader how to depersist the object. This is currently not
+    extensible. For a given mimetype the value must be set accordingly:
+
+    Note - application/x-microsoft.net.object.binary.base64 is the format
+    that the ResXResourceWriter will generate, however the reader can
+    read any of the formats listed below.
+
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 15 - 14
Scada/FormMain.Designer.cs

@@ -38,7 +38,7 @@
             uiLabel5 = new Sunny.UI.UILabel();
             uiLabel4 = new Sunny.UI.UILabel();
             uiScrollingText1 = new Sunny.UI.UIScrollingText();
-            uiLabel3 = new Sunny.UI.UILabel();
+            lbl_User = new Sunny.UI.UILabel();
             pictureBox2 = new PictureBox();
             uiLabel2 = new Sunny.UI.UILabel();
             uiLabel1 = new Sunny.UI.UILabel();
@@ -121,7 +121,7 @@
             uiPanel1.Controls.Add(uiLabel5);
             uiPanel1.Controls.Add(uiLabel4);
             uiPanel1.Controls.Add(uiScrollingText1);
-            uiPanel1.Controls.Add(uiLabel3);
+            uiPanel1.Controls.Add(lbl_User);
             uiPanel1.Controls.Add(pictureBox2);
             uiPanel1.Controls.Add(uiLabel2);
             uiPanel1.Controls.Add(uiLabel1);
@@ -249,18 +249,18 @@
             uiScrollingText1.MouseDown += Panel_MouseDown;
             uiScrollingText1.MouseMove += Panel_MouseMove;
             // 
-            // uiLabel3
+            // lbl_User
             // 
-            uiLabel3.BackColor = Color.Transparent;
-            uiLabel3.Font = new Font("宋体", 18F);
-            uiLabel3.ForeColor = Color.FromArgb(48, 48, 48);
-            uiLabel3.Location = new Point(486, 9);
-            uiLabel3.Name = "uiLabel3";
-            uiLabel3.Size = new Size(103, 39);
-            uiLabel3.TabIndex = 1;
-            uiLabel3.Text = "工程师";
-            uiLabel3.MouseDown += Panel_MouseDown;
-            uiLabel3.MouseMove += Panel_MouseMove;
+            lbl_User.BackColor = Color.Transparent;
+            lbl_User.Font = new Font("宋体", 18F);
+            lbl_User.ForeColor = Color.FromArgb(48, 48, 48);
+            lbl_User.Location = new Point(486, 9);
+            lbl_User.Name = "lbl_User";
+            lbl_User.Size = new Size(103, 39);
+            lbl_User.TabIndex = 1;
+            lbl_User.Text = "工程师";
+            lbl_User.MouseDown += Panel_MouseDown;
+            lbl_User.MouseMove += Panel_MouseMove;
             // 
             // pictureBox2
             // 
@@ -271,6 +271,7 @@
             pictureBox2.Size = new Size(65, 65);
             pictureBox2.TabIndex = 3;
             pictureBox2.TabStop = false;
+            pictureBox2.Click += pictureBox2_Click;
             pictureBox2.MouseDown += Panel_MouseDown;
             pictureBox2.MouseMove += Panel_MouseMove;
             // 
@@ -581,7 +582,7 @@
         private Sunny.UI.UIPanel uiPanel1;
         private PictureBox pictureBox1;
         private Sunny.UI.UILabel uiLabel1;
-        private Sunny.UI.UILabel uiLabel3;
+        private Sunny.UI.UILabel lbl_User;
         private PictureBox pictureBox2;
         private Sunny.UI.UILabel uiLabel2;
         private Sunny.UI.UILabel uiLabel4;

+ 116 - 4
Scada/FormMain.cs

@@ -1,3 +1,6 @@
+using BLL;
+using BLL.Dto.AuthDto;
+using BLL.Manager;
 using Helper;
 using HZY.Framework.DependencyInjection;
 using IoTClient.Clients.PLC;
@@ -12,16 +15,31 @@ using Sunny.UI;
 
 namespace Scada
 {
-    public partial class FormMain : UIHeaderAsideMainFooterFrame,IScopedSelfDependency
+    public partial class FormMain : UIHeaderAsideMainFooterFrame, IScopedSelfDependency
     {
         private bool plcIsConnected;
         private readonly ILogger<FormMain> _logger;
         private Point mPoint;
         private CancellationTokenSource cts = new CancellationTokenSource();
-
-        public FormMain(ILogger<FormMain> logger)
+        private readonly UserManager _userManager;
+        private Dictionary<string, Control> pageControls = new Dictionary<string, Control>
+{
+    { "控制模块", Globals.ServiceProvider.GetRequiredService<PageTotalEquipmentControl>() },
+    { "用户模块", Globals.ServiceProvider.GetRequiredService<PageUserManage>() },
+    { "权限模块", Globals.ServiceProvider.GetRequiredService<PageAuthManage>() },
+    { "监控模块1", Globals.ServiceProvider.GetRequiredService<PageEquipmentMonitor1>() },
+    { "监控模块2", Globals.ServiceProvider.GetRequiredService<PageEquipmentMonitor2>() },
+    { "监控模块3", Globals.ServiceProvider.GetRequiredService<PageEquipmentMonitor3>() },
+    { "配方模块", Globals.ServiceProvider.GetRequiredService<PageRecipeManage>() },
+    { "日志模块", Globals.ServiceProvider.GetRequiredService<PageLogManage>() },
+    { "报表模块", Globals.ServiceProvider.GetRequiredService<PageReportManage>() },
+    { "图表模块", Globals.ServiceProvider.GetRequiredService<PageChartManage>() },
+    { "参数模块", Globals.ServiceProvider.GetRequiredService<PageSystemParameterSet>() }
+};
+        public FormMain(ILogger<FormMain> logger,UserManager userManager)
         {
             _logger = logger ?? throw new ArgumentNullException(nameof(logger));
+            _userManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
             InitializeComponent();
             InitAsideUI();
             InitHeaderUI();
@@ -79,7 +97,7 @@ namespace Scada
             Globals.SiemensClient = new SiemensClient(Globals.CpuType, Globals.IpAddress, Globals.Port, Globals.Slot, Globals.Rack, Globals.ConnectTimeOut);
             var connectResult = Globals.SiemensClient.Open();
 
-            if(connectResult.IsSucceed)
+            if (connectResult.IsSucceed)
             {
                 plcIsConnected = true;
                 this.led_PlcState.On = true;
@@ -282,5 +300,99 @@ namespace Scada
                 this.Location = new Point(this.Location.X + e.X - mPoint.X, this.Location.Y + e.Y - mPoint.Y);
             }
         }
+
+        private void pictureBox2_Click(object sender, EventArgs e)
+        {
+            //把Aside折叠起来
+            Aside.CollapseAll();
+            Aside.SelectFirst();
+
+            var frmLogin = Globals.ServiceProvider.GetRequiredService<FormLogin>();
+            frmLogin.ShowDialog();
+            if (frmLogin.IsLogin)
+            {
+                //更新登录用户
+                this.lbl_User.Text = frmLogin.UserName;
+                foreach (var control in pageControls.Values)
+                {
+                    control.Enabled = true;
+                }
+            }
+        }
+
+        #region 控制权限
+
+        /// <summary>
+        /// 侧边栏菜单折叠事件(折叠之前)
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private async void Aside_BeforeExpand(object sender, TreeViewCancelEventArgs e)
+        {
+            UINavMenu uINavMenu = sender as UINavMenu;
+
+            string moduleName = e.Node.Text;
+
+            string user = this.lbl_User.Text;
+            var roleRes = await _userManager.GetUserAuthAsync(new BLL.Dto.UserDto.QueryUserRoleDto() { UserName = user });
+
+            if (roleRes.Status == SystemEnums.Result.Success)
+            {
+                if (roleRes.Data[0].Role != "管理员")
+                {
+                    var authRes = await _authManager.GetAuthAsync(new QueryAuthDto { Role = roleRes.Data[0].Role });
+                    if (authRes.Status == SystemEnums.Result.Success)
+                    {
+                        UpdateControlAccess(moduleName, authRes.Data[0], pageControls);
+                    }
+                }
+            }
+        }
+
+        private void UpdateControlAccess(string moduleName, QueryAuthResultDto authDto, Dictionary<string, Control> pageControls)
+        {
+            switch (moduleName)
+            {
+                case "控制模块":
+                    pageControls["控制模块"].Enabled = authDto.ControlModule;
+                    break;
+
+                case "用户模块":
+                    pageControls["用户模块"].Enabled = false;
+                    pageControls["权限模块"].Enabled = false;
+                    break;
+
+                case "监控模块":
+                    pageControls["监控模块"].Enabled = authDto.MonitorModule;
+                    pageControls["监控模块1"].Enabled = authDto.MonitorModule;
+                    pageControls["监控模块2"].Enabled = authDto.MonitorModule;
+                    break;
+
+                case "配方模块":
+                    pageControls["配方模块"].Enabled = authDto.RecipeModule;
+                    break;
+
+                case "日志模块":
+                    pageControls["日志模块"].Enabled = authDto.LogModule;
+                    break;
+
+                case "报表模块":
+                    pageControls["报表模块"].Enabled = authDto.ReportModule;
+                    break;
+
+                case "图表模块":
+                    pageControls["图表模块"].Enabled = authDto.ChartModule;
+                    break;
+
+                case "参数模块":
+                    pageControls["参数模块"].Enabled = authDto.ParamModule;
+                    break;
+
+                default:
+                    break;
+            }
+        }
+
+        #endregion 控制权限
     }
 }

+ 3 - 0
Scada/Page/PageAuthManage.Designer.cs

@@ -124,6 +124,7 @@
             btn_UpdateEngAuth.TabIndex = 4;
             btn_UpdateEngAuth.Text = "修改工程师权限";
             btn_UpdateEngAuth.TipsFont = new Font("宋体", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
+            btn_UpdateEngAuth.Click += btn_UpdateEngAuth_Click;
             // 
             // btn_UpdateOpAuth
             // 
@@ -135,6 +136,7 @@
             btn_UpdateOpAuth.TabIndex = 5;
             btn_UpdateOpAuth.Text = "修改操作员权限";
             btn_UpdateOpAuth.TipsFont = new Font("宋体", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
+            btn_UpdateOpAuth.Click += btn_UpdateOpAuth_Click;
             // 
             // btn_UpdateVisitorAuth
             // 
@@ -146,6 +148,7 @@
             btn_UpdateVisitorAuth.TabIndex = 6;
             btn_UpdateVisitorAuth.Text = "修改访客权限";
             btn_UpdateVisitorAuth.TipsFont = new Font("宋体", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
+            btn_UpdateVisitorAuth.Click += btn_UpdateVisitorAuth_Click;
             // 
             // PageAuthManage
             // 

+ 114 - 2
Scada/Page/PageAuthManage.cs

@@ -7,6 +7,10 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using BLL.Dto;
+using BLL.Dto.AuthDto;
+using BLL.Manager;
+using Helper;
 using HZY.Framework.DependencyInjection;
 using Sunny.UI;
 
@@ -14,14 +18,122 @@ namespace Scada.Page
 {
     public partial class PageAuthManage : UIPage, ISingletonSelfDependency
     {
-        public PageAuthManage()
+        private readonly AuthManager _authManager;
+        public PageAuthManage(AuthManager authManager)
         {
             InitializeComponent();
+            _authManager = authManager;
+            this.Load += PageAuthManage_Load;
         }
 
-        private void PageAuthManage_Load(object sender, EventArgs e)
+        private async void PageAuthManage_Load(object sender, EventArgs e)
         {
+            await LoadAuthAynsc(SystemEnums.UserRole.工程师, cbg_Engineer);
+            await LoadAuthAynsc(SystemEnums.UserRole.访客, cbg_Visitor);
+            await LoadAuthAynsc(SystemEnums.UserRole.操作员, cbg_Operator);
+        }
+
+        private async Task LoadAuthAynsc(SystemEnums.UserRole role, UICheckBoxGroup cbg)
+        {
+            var result = await _authManager.GetAuthAsync(new QueryAuthDto() { Role = role.ToString() });
+
+            if (result.Result == SystemEnums.Result.Success)
+            {
+                var auths = result.Data[0];
+                List<int> ints = new List<int>();
+
+                if (auths.ControlModule)
+                {
+                    ints.Add(0);
+                }
+                if (auths.MonitorModule)
+                {
+                    ints.Add(1);
+                }
+                if (auths.RecipeModule)
+                {
+                    ints.Add(2);
+                }
+                if (auths.LogModule)
+                {
+                    ints.Add(3);
+                }
+                if (auths.ReportModule)
+                {
+                    ints.Add(4);
+                }
+                if (auths.ChartModule)
+                {
+                    ints.Add(5);
+                }
+                if (auths.ParamModule)
+                {
+                    ints.Add(6);
+                }
+
+                cbg.SelectedIndexes = ints;
+            }
+            else
+            {
+                UIMessageBox.ShowError(result.Msg);
+            }
+        }
+
+        private async void btn_UpdateEngAuth_Click(object sender, EventArgs e)
+        {
+            var result =await  _authManager.GetAuthAsync(new QueryAuthDto() { Role = SystemEnums.UserRole.工程师.ToString() });
+            var id = result.Data[0].Id;
+
+            await UpdateAuthAsync(SystemEnums.UserRole.工程师,id, cbg_Engineer);
+        }
+
+        private async void btn_UpdateOpAuth_Click(object sender, EventArgs e)
+        {
+            var result = await _authManager.GetAuthAsync(new QueryAuthDto() { Role = SystemEnums.UserRole.操作员.ToString() });
+            var id = result.Data[0].Id;
+
+            await UpdateAuthAsync(SystemEnums.UserRole.操作员, id, cbg_Operator);
+        }
 
+        private async void btn_UpdateVisitorAuth_Click(object sender, EventArgs e)
+        {
+            var result = await _authManager.GetAuthAsync(new QueryAuthDto() { Role = SystemEnums.UserRole.访客.ToString() });
+            var id = result.Data[0].Id;
+
+            await UpdateAuthAsync(SystemEnums.UserRole.访客, id, cbg_Visitor);
+        }
+
+        private async Task UpdateAuthAsync(SystemEnums.UserRole role,int id, UICheckBoxGroup cbg)
+        {
+            var authList = new List<int>();
+            for(int i =0;i<cbg.Items.Count;i++)
+            {
+                if(cbg.SelectedIndexes.Contains(i))
+                {
+                    authList.Add(i);
+                }
+            }
+            UpdateAuthDto updateAuthDto = new UpdateAuthDto()
+            {
+                Id = id,
+                Role = role.ToString(),
+                ControlModule = authList.Contains(0),
+                MonitorModule = authList.Contains(1),
+                RecipeModule = authList.Contains(2),
+                LogModule = authList.Contains(3),
+                ReportModule = authList.Contains(4),
+                ChartModule = authList.Contains(5),
+                ParamModule = authList.Contains(6)
+            };
+            var result = await _authManager.UpdateAuthAsync(updateAuthDto);
+            if (result.Result == SystemEnums.Result.Success)
+            {
+                UIMessageTip.ShowOk("更新成功");
+            }
+            else
+            {
+                UIMessageTip.ShowError(result.Msg);
+            }
         }
     }
 }