function isHaveVideo() {
readFile({
path: 'fs://goVideo.txt'
}, function(ret, err) {
if (ret.status) {
return true;
} else {
return false;
}
});
}
return返回是'undefine'。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
像这种异步请求,应该通过传入
回调函数或使用Promise库之类的方法获取值。例如:
但看你这个请求的地址,应该是
hybrid程序里用吧?Native调用js?大概就是成功函数没执行,执行的失败函数,而失败函数没有