Commit ec74e6b8 authored by 郑磊's avatar 郑磊

update

parent 93a89c4c
......@@ -51,22 +51,17 @@ function callAndroidApi(name: string, ...args: any[]): void {
let ack: Function | undefined = undefined
if (typeof args[0] === 'function') {
ack = args[0]
} else if (typeof args[1] === 'function') {
} else {
params = args[0]
ack = args[1]
}
let result: any
const invokeArgs: any[] = []
if (typeof params !== 'undefined' && params !== null) {
//result = window.liveapp[name](JSON.stringify(params))
params = JSON.stringify(JSON.stringify(params))
} else {
params = ''
invokeArgs.push(JSON.stringify(params))
}
const evalCode = `window.liveapp.${name}(${params})`
console.log(evalCode)
result = eval(evalCode)
const result = window.liveapp[name](...invokeArgs)
if (typeof ack === 'function') {
ack(result)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment