This commit is contained in:
2020-07-09 08:50:24 +08:00
parent 13d25f4707
commit c523462b82
1818 changed files with 174940 additions and 582 deletions

View File

@@ -8,13 +8,19 @@ NetProto.send = {}
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
local host = "47.111.20.34"
local port = 29004
-- local host = "192.168.1.126"
-- local port = 29000
-- local baseUrl = "http://app.ttf-cti.com:29000/open_api/"
local baseUrl = "http://47.111.20.34:29004/open_api/"
local baseUrl = joinStr("http://", host, ":", port, "/open_api/")
-- local baseUrl2 = "http://47.111.20.34:29004/open_api/"
-- local socketUrl = "ws://app.ttf-cti.com:29000/tr_socket/websocket/"
local socketUrl = "ws://47.111.20.34:29004/tr_socket/websocket/"
-- local socketUrl = "ws://47.111.20.34:29004/tr_socket/websocket/"
local socketUrl = joinStr("ws://", host, ":", port, "/tr_socket/websocket/")
---@type Dist.SpringWebsocket.Client
local socket = SocketClient.self
local socket = Client4Stomp.self
local appid = 2020158
local appsecret = "ea042bc86428ca968756a6e47b10742d"
local isDebug = true
@@ -62,7 +68,7 @@ local dispatch = function(content, params)
printe(joinStr("cmd:[", cmd, "]code:[", code, "]msg:", msg))
-- retInfor.msg = Localization.Get(joinStr("Error_", succ))
if not isNilOrEmpty(msg) then
CLAlert.add(msg, Color.yellow, 1)
MyUtl.toastE(msg)
end
hideHotWheel()
else
@@ -103,7 +109,7 @@ end
NetProto.sendGet = function(cmd, map, callback, failedCallback, orgs, _baseUrl)
if isNilOrEmpty(NetProto.sign) and (cmd ~= NetProto.cmds.getTokenForAPI) then
CLAlert.add("与服务器失去联络,请重试!", Color.yellow, 1)
CLAlert.add("与服务器失去联络,请重试!", Color.white, 1)
NetProto.init()
return
end
@@ -146,12 +152,12 @@ function NetProto.init(callback)
onGetToken(data.result)
Utl.doCallback(callback, true)
else
CLAlert.add(data.msg, Color.yellow, 1)
CLAlert.add(data.msg, Color.white, 1)
Utl.doCallback(callback, false)
end
end,
function()
CLAlert.add("取得会话ID失败", Color.yellow, 1)
CLAlert.add("取得会话ID失败", Color.white, 1)
Utl.doCallback(callback, false)
end
)
@@ -233,7 +239,7 @@ NetProto.cmds = {
order_report = "order_report", -- 客户类型分布
target_report = "target_report", -- 客户类型分布
update_customer = "update_customer", -- 更新客户信息
save_customer = "save_customer", -- 新建客户
save_customer = "save_customer" -- 新建客户
}
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
@@ -386,7 +392,7 @@ NetProto.sendSocket = function(content, callback, timeOutSec)
content.companyId = NetProto.comanyId
content.callbackId = setCallback(callback, content, timeOutSec)
local contentStr = json.encode(content)
InvokeEx.invoke(NetProto.doSendMsg, contentStr, 0.1)
NetProto.doSendMsg(contentStr)
end
NetProto.doSendMsg = function(contentStr)