.catch((err:BusinessError)=>{
console.log('——————————————— 请求失败 ————————————————\n'+ '请求地址:' + url + '\n请求参数:' +JSON.stringify(jsonStr)+ '\n请求错误:'+`${err}`);
console.log('err:'+`${err}`)
response.Message = err.message;
response.Code = err.code;
return response;
})
在高版本中,必须指定类型,arkts中是使用的BusinessError ,不过要高版本中import { BusinessError } from '@ohos.base'
网友评论