提交 5226c700 编写于 作者: KK's avatar KK

代码格式化

上级 ca02acfd
......@@ -101,7 +101,7 @@ export class Interceptors {
});
axios.interceptors.response.use((response: any) => {
if(response.headers && response.headers['refreshtoken'] && localStorage.getItem('token')){
if (response.headers && response.headers['refreshtoken'] && localStorage.getItem('token')) {
this.refreshToken(response);
}
return response;
......@@ -158,17 +158,17 @@ export class Interceptors {
* @param {*} [data={}]
* @memberof Interceptors
*/
private refreshToken(data:any = {}):void{
if(data && data.config && (data.config.url == "/uaa/refreshToken")){
private refreshToken(data: any = {}): void {
if (data && data.config && (data.config.url == "/uaa/refreshToken")) {
return;
}
Http.getInstance().post('/uaa/refreshToken',localStorage.getItem('token'),false).then((response: any) => {
Http.getInstance().post('/uaa/refreshToken', localStorage.getItem('token'), false).then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
if (data ) {
if (data) {
localStorage.setItem('token', data);
}
}else{
} else {
console.log("刷新token出错");
}
}).catch((error: any) => {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册