标签:err angular bsp hand author http nbsp style ica
基本思路是调用登录接口,获取token,使用token请求其他JWT接口:
getHomeDetails(): Observable<HomeDetails> { let headers = new Headers(); headers.append(‘Content-Type‘, ‘application/json‘); let authToken = localStorage.getItem(‘auth_token‘); headers.append(‘Authorization‘, `Bearer ${authToken}`); return this.http.get(this.baseUrl + "/dashboard/home",{headers}) .map(response => response.json()) .catch(this.handleError); }
Angular调用Asp.net Core JWT Authentication接口
标签:err angular bsp hand author http nbsp style ica
原文地址:https://www.cnblogs.com/slmk/p/9875872.html