UNPKG

bixi

Version:

企业级中后台前端解决方案

34 lines (28 loc) 737 B
--- order: 30 title: 常见问题 type: Other --- ### 如何捕获无Token时被拦截信息? ```ts // 利用订阅 Error this.http.get('/user').subscribe( res => console.log('success', res), err => console.error('error', err) ); // 或使用 catchError this.http.get('/user').pipe( catchError(err => { console.error('error', err); return of({}); }) ).subscribe(); ``` ### 为何我项目进不去,控制台也不报错 ```ts const bixiAuthConfig: BixiAuthConfig = { store_key: 'bixi-store-key', // 通常是因为拦截器拦截了不该拦截的请求,请检查 ignores 是否已经列出所有需要被忽略的请求(包括 json 文件的获取) ignores: [/\/login/, /assets\//, /passport\//] }; ```