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 {
  }
}

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

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

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 服务打包报错
415浏览 • 1回复 待解决
HarmonyOS 服务各种API报错
691浏览 • 1回复 待解决
HarmonyOS 服务静默登录报错1001500001
160浏览 • 1回复 待解决
HarmonyOS 服务获取华为ID报错
280浏览 • 1回复 待解决
HarmonyOS服务与原子服务
13132浏览 • 2回复 待解决
服务是否可以全程使用js实现
1923浏览 • 1回复 待解决
HarmonyOS 服务卡片
289浏览 • 1回复 待解决
HarmonyOS 服务相关实现
439浏览 • 1回复 待解决
HarmonyOS 服务应用跳转
277浏览 • 1回复 待解决
HarmonyOS 服务申请证书
377浏览 • 1回复 待解决
HarmonyOS 服务服务卡片的区别
153浏览 • 1回复 待解决
HarmonyOS 服务是什么
319浏览 • 1回复 待解决
HarmonyOS 服务卡片和服务的区别
479浏览 • 1回复 待解决
服务服务卡片的区别
5127浏览 • 1回复 待解决
HarmonyOS 服务的logo规范
361浏览 • 1回复 待解决
HarmonyOS 服务上架问题?
488浏览 • 1回复 待解决