|
|
@ -50,11 +50,15 @@ namespace AKS.EnterpriseLibrary.WebBrowser |
|
|
|
string result = string.Empty; |
|
|
|
string result = string.Empty; |
|
|
|
content = Base64str2(content); |
|
|
|
content = Base64str2(content); |
|
|
|
if (!string.IsNullOrEmpty(content)) |
|
|
|
if (!string.IsNullOrEmpty(content)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
{ |
|
|
|
var json = content.ConvertToAnonymousType(new |
|
|
|
var json = content.ConvertToAnonymousType(new |
|
|
|
{ |
|
|
|
{ |
|
|
|
code = default(string) |
|
|
|
code = default(string) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
if (json != null) |
|
|
|
|
|
|
|
{ |
|
|
|
//接收指令和参数 |
|
|
|
//接收指令和参数 |
|
|
|
string keycode = json.code; |
|
|
|
string keycode = json.code; |
|
|
|
switch (keycode) |
|
|
|
switch (keycode) |
|
|
@ -133,6 +137,13 @@ namespace AKS.EnterpriseLibrary.WebBrowser |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
result = "{\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"400\",\"status\":true,\"data\":\"参数解析错误\"}"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch { result = "{\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"400\",\"status\":true,\"data\":\"参数解析错误\"}"; } |
|
|
|
|
|
|
|
finally { } |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
result = "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"无效指令\"}"; |
|
|
|
result = "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"无效指令\"}"; |
|
|
@ -148,7 +159,8 @@ namespace AKS.EnterpriseLibrary.WebBrowser |
|
|
|
byte[] bytes = SerializeContent(result); |
|
|
|
byte[] bytes = SerializeContent(result); |
|
|
|
ws.Reply(s.ToString(), new SAEA.WebSocket.Model.WSProtocal(SAEA.WebSocket.Type.WSProtocalType.Text, bytes)); |
|
|
|
ws.Reply(s.ToString(), new SAEA.WebSocket.Model.WSProtocal(SAEA.WebSocket.Type.WSProtocalType.Text, bytes)); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
string result = "{\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"收到客户端心跳\"}"; |
|
|
|
string result = "{\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"收到客户端心跳\"}"; |
|
|
|
byte[] bytes = SerializeContent(result); |
|
|
|
byte[] bytes = SerializeContent(result); |
|
|
|
ws.Reply(s.ToString(), new SAEA.WebSocket.Model.WSProtocal(SAEA.WebSocket.Type.WSProtocalType.Text, bytes)); |
|
|
|
ws.Reply(s.ToString(), new SAEA.WebSocket.Model.WSProtocal(SAEA.WebSocket.Type.WSProtocalType.Text, bytes)); |
|
|
|