jxhczhl / JsRpc

远程调用(rpc)浏览器方法,免去抠代码补环境
1.26k stars 313 forks source link

data:object object #19

Closed wubantudl closed 11 months ago

wubantudl commented 11 months ago

{'data': '[object Object]', 'group': 'test', 'name': 'leigege', 'status': 200}

jxhczhl commented 11 months ago

注册的方法中,加个JSON.stringify

wubantudl commented 11 months ago

var demo = new Hlclient("ws://127.0.0.1:12080/ws?group=test&name=leigege"); demo.regAction("sign_t", function (resolve, param) { t = Date.parse(new Date()); var list = { "page": window.page, "sign": window.sign(window.page + '|' + t.toString()), "t": t, } resolve(JSON.stringify(list)) })

谢谢大哥