Android代码
@UniJSMethod(uiThread = false)
public JSONObject Read() {
JSONObject data = new JSONObject();
mManager.setsession(false);
Reader.INFO taginfo = mManager.Read();
if(!taginfo.result){
data.put("errmsg",taginfo.errmsg);
return data;
}
data.put("data",taginfos.data);
return data;
}
JS代码
this.SFHelper = uni.requireNativePlugin("SFModule");
var ret = this.SFHelper.Read();
console.log('read:',ret.data);
1 个回复
b***@sina.com (作者)
改成以下代码,还是不返回。
@UniJSMethod(uiThread = true)
public JSONObject Read() {
JSONObject data = new JSONObject();
mManager.setsession(false);
Reader.INFO taginfo = mManager.Read();
if(!taginfo.result){
data.put("errmsg",taginfo.errmsg);
return data;
}
data.put("data",taginfos.data);
return data;
}