7

Angular 学起来真是太难了, 国内资料少, 用 G 搜呢,总感觉表达不准确,搜不到好的...

 3 years ago
source link: https://www.v2ex.com/t/800937
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Angular

Angular 学起来真是太难了, 国内资料少, 用 G 搜呢,总感觉表达不准确,搜不到好的结果

  loveuer · 9 小时 22 分钟前 · 710 次点击

请教一下大佬们, 我现在有一个情况是这样的,后端我统一 返回格式是:

{
  "status": 200,
  "msg: "xxx success",
  "data": any
}

我想通过 拦截器 或者在 service 里面将 status 判断好了, 给 component 的数据就 仅是上面的 data, 出错就给个 默认值 这样的效果,但我实在不知道怎么实现了, 还请大家指点一二。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK