jxhczhl / JsRpc

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

接口调用超时 #20

Open niutouren747 opened 8 months ago

niutouren747 commented 8 months ago

如图注册函数,调用接口,JS正常执行,接口返回超时;这是什么原因?

图片 图片
KingJem commented 6 months ago
Hlclient.prototype.handlerRequest = async function (requestJson) {
    var _this = this;
    var result = JSON.parse(await requestJson.text());
    if (!result['action']) {
        this.sendResult('', 'need request param {action}');
        return
    }}

handlerRequest 的回调函数改为异步就行了 requestJson 为blog 对象而不是string 版本用的v1.0.2,其他地方看着改就行了

bboysteed commented 5 months ago

一样的问题

skr-rks commented 1 month ago

我也遇到这个问题了,把浏览器的断点关了就好了