HarmonyOS 元服务中使用axios报错2300028

import axios, { AxiosResponse } from '@ohos/axios';
async fn4() {
  try {
    const res: AxiosResponse<string> = await axios.get<string, AxiosResponse<string>, null>(
      'xxx',
    )
    console.log(JSON.stringify(res.data))
  } catch (e) {
    console.log(JSON.stringify(e.message))
  } finally {
  }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.

同样的代码,网络权限已添加。在App应用中正常,在元服务中报错如下

{\"code\":2300028,\"message\":\"Timeout was reached\"} 
  • 1.

axios或者说http请求在元服务中要额外其它配置吗?

HarmonyOS
2025-01-10 09:23:09
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
Heiang

元服务报错2300998需要到AGC上配置域名白名单,执行流程可参考如下:https://developer.huawei.com/consumer/cn/doc/atomic-guides-V5/agc-help-harmonyos-server-domain-V5

分享
微博
QQ
微信
回复
2025-01-10 11:29:14


相关问题
HarmonyOS 服务打包报错
650浏览 • 1回复 待解决
HarmonyOS 服务各种API报错
896浏览 • 1回复 待解决
HarmonyOS 服务静默登录报错1001500001
298浏览 • 1回复 待解决
HarmonyOS 服务获取华为ID报错
483浏览 • 1回复 待解决
HarmonyOS服务与原子服务
13477浏览 • 2回复 待解决
HarmonyOS 服务卡片
459浏览 • 1回复 待解决
服务是否可以全程使用js实现
2064浏览 • 1回复 待解决
HarmonyOS 服务相关实现
690浏览 • 1回复 待解决
HarmonyOS 服务申请证书
586浏览 • 1回复 待解决
HarmonyOS 服务应用跳转
605浏览 • 1回复 待解决
HarmonyOS 服务服务卡片的区别
339浏览 • 1回复 待解决
HarmonyOS 服务是什么
534浏览 • 1回复 待解决
HarmonyOS 服务卡片和服务的区别
789浏览 • 1回复 待解决
服务服务卡片的区别
5699浏览 • 1回复 待解决
HarmonyOS 服务上架问题?
655浏览 • 1回复 待解决
HarmonyOS 服务怎么上架
546浏览 • 1回复 待解决
HarmonyOS 服务的logo规范
588浏览 • 1回复 待解决