可以获取到接口对象,但是读不到具体内容是为什么啊


接口:
export interface userInfo{
  address:string
  age:number
  avatar:string
  flag:string
  id:number
  nickname:string
  password:string
  phone:string
  sex:string
  username:string
}
调用用户首选项:
async aboutToAppear(){
    this.vv = await preferencesUtil.getKey("myPreferences", 'userInfo', 'unknowns') as userInfo
    console.log('aboutToAppear==',this.vv)
    console.log('this.vv.avatar==',this.vv.avatar)
  }
log:
aboutToAppear== {"id":-1,"username":"未登录","password":"","age":-1,"sex":"-","nickname":"-","address":"-","phone":"-","avatar":'aaa',"flag":"1"}
this.vv.avatar== undefind
#鸿蒙
2024-07-28 22:11:56
浏览
收藏 0
回答 0
待解决
相关问题
MQTT为什么编译出错
2624浏览 • 1回复 待解决
为什么不到 @arkui-x.bridge?
742浏览 • 1回复 待解决
有没有接口获取到组件的宽度
617浏览 • 1回复 待解决
现在最新的文件交互接口哪个?
285浏览 • 1回复 待解决
Harmony手表为什么不能安装apk
3630浏览 • 1回复 待解决
@Prop 为什么不能提供默认值
1959浏览 • 1回复 待解决