mirror of
https://git.mirrors.martin98.com/https://github.com/cilame/v_jstools
synced 2025-08-18 07:36:04 +08:00
add
This commit is contained in:
parent
264bb30aa7
commit
cef57b90da
@ -161,19 +161,9 @@ function mk_websocket_hook_code(){
|
|||||||
websocket.onmessage = function(e){
|
websocket.onmessage = function(e){
|
||||||
var info = JSON.parse(e.data)
|
var info = JSON.parse(e.data)
|
||||||
console.log('websocket.onmessage', info)
|
console.log('websocket.onmessage', info)
|
||||||
if (info.evalstring){
|
|
||||||
// 这里让你可以通过 /?evalstring=123 传入代码直接执行,
|
|
||||||
try{
|
|
||||||
var ret = v_eval(v_decodeURIComponent(info.evalstring))
|
|
||||||
}catch(e){
|
|
||||||
var ret = e.stack
|
|
||||||
}
|
|
||||||
websocket.send(ret)
|
|
||||||
}else{
|
|
||||||
// 这里处理请求参数以及对应rpc函数调用,返回参数用字符串传递回 websocket。回传字符串即可。
|
// 这里处理请求参数以及对应rpc函数调用,返回参数用字符串传递回 websocket。回传字符串即可。
|
||||||
var ret = '你好'
|
var ret = '你好'
|
||||||
websocket.send(ret)
|
websocket.send(ret)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}()
|
}()
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user