diff --git a/SGGL/BLL/Common/YunMouHelper.cs b/SGGL/BLL/Common/YunMouHelper.cs
index 10691aad..5dd3896f 100644
--- a/SGGL/BLL/Common/YunMouHelper.cs
+++ b/SGGL/BLL/Common/YunMouHelper.cs
@@ -80,17 +80,21 @@ namespace BLL.Common
///
///
///
- public static string addDevices(string deviceSerial, string groupNo, string validateCode, string access_token)
+ public static string addDevices(string deviceSerial, string groupNo, string validateCode, string access_token,out string res)
{
string data = "{\"deviceSerial\":\"" + deviceSerial + "\",\"groupNo\":\"" + groupNo + "\",\"validateCode\":\"" + validateCode + "\"}";
string result = Post(YunMouUrl + "api/v1/open/basic/devices/create", data, "application/json;charset=UTF-8", access_token);
ErrLogInfo.WriteLog(result);
-
+
var j2 = JsonConvert.DeserializeObject(result);
if (j2.code == "200")
+ {
+ res = j2.message;
return j2.data.groupId;
+ }
else
{
+ res = j2.message;
return "";
}
}
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs
index f85822d3..dd1de109 100644
--- a/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs
@@ -170,9 +170,10 @@ namespace FineUIPro.Web.ProjectData
{
var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
var token = YunMouHelper.getToken();
+ string addMessage = "";
string data;
data = Regex.Replace(project.ProjectCode, "[^0-9A-Fa-f]", "", RegexOptions.IgnoreCase);
- var YunMouDeviceId = YunMouHelper.addDevices(device.DeviceSerial, data, device.ValidateCode, token);//添加设备
+ var YunMouDeviceId = YunMouHelper.addDevices(device.DeviceSerial, data, device.ValidateCode, token,out addMessage);//添加设备
if (!string.IsNullOrEmpty(YunMouDeviceId))
{
device.YunMouDeviceId = YunMouDeviceId;
@@ -182,7 +183,7 @@ namespace FineUIPro.Web.ProjectData
}
else
{
- Alert.ShowInTop("同步设备出错!", MessageBoxIcon.Warning);
+ Alert.ShowInTop("同步设备出错:"+ addMessage, MessageBoxIcon.Warning);
}
}
diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs
index d2471ca8..0473f6ee 100644
--- a/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs
@@ -106,7 +106,8 @@ namespace FineUIPro.Web.ProjectData
var token = YunMouHelper.getToken();
string data;
data = Regex.Replace(project.ProjectCode, "[^0-9A-Fa-f]", "", RegexOptions.IgnoreCase);
- device.YunMouDeviceId = YunMouHelper.addDevices(device.DeviceSerial, data, device.ValidateCode, token);//添加设备之后,将权限添加到权限组
+ string addMessage = "";
+ device.YunMouDeviceId = YunMouHelper.addDevices(device.DeviceSerial, data, device.ValidateCode, token,out addMessage);//添加设备之后,将权限添加到权限组
var res = YunMouHelper.addDevicesToGroups(project.YunMouGroupId, new string[] { device.DeviceSerial }, token);//添加到权限组
if (!string.IsNullOrEmpty(res))
{