HarmonyOS 鸿蒙Next 请问为什么我不能查询到数据库里的时间呢
HarmonyOS 鸿蒙Next 请问为什么我不能查询到数据库里的时间呢
```javascript
searchClocks() {
}
this.country=this.searchQuery;
this.encodecountry=encodeURI(this.country);
this.urllast="https://mock.apifox.com/m1/3777281-0-default/city?country="+this.encodecountry;
let httpRequest = http.createHttp();
httpRequest.request(
this.urllast,
{
method:http.RequestMethod.GET,
},
(err,data)=>
{
if (!err)
{
this.n=parseInt(JSON.parse(data.result).data.time)
httpRequest.destroy();
}
else{
httpRequest.destroy();
}}
},
以上是代码
{
"code": 1,
"msg": "Success",
"data": {
"world_clocks": [
{
"id": 3,
"uid": 2,
"city_id": 2437,
"city": "阿比让",
"time": "-8",
"country": "科特迪瓦"
}
]
}
}
这是数据库示例
更多关于HarmonyOS 鸿蒙Next 请问为什么我不能查询到数据库里的时间呢的实战教程也可以访问 https://www.itying.com/category-93-b0.html
2 回复