HarmonyOS的網(wǎng)絡與連接訪問模式默認是:https,如果你是http開頭的阶牍,請在config.json文件中,找到 deviceConfig節(jié)點星瘾,添加如下配置:
具體位置:
具體代碼:
"deviceConfig": {
"network": {
"cleartextTraffic": "true",
"securityConfig": {
"domainSettings": {
"cleartextPermitted": "true",
"domains": [
{
"subdomains": "true",
"name": "guolin.tech"
}
]
}
}
}
}