Skip to content

Commit 03399d7

Browse files
author
alanhg
committed
fixed #13
1 parent 989fc0b commit 03399d7

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
## resources:
2222

23-
- [ionic2](https://github.com/driftyco/ionic)
24-
- [angular2](https://angular.io/)
23+
- [ionic2(v3)](https://github.com/driftyco/ionic)
24+
- [angular4](https://angular.io/)
2525
- [echarts](http://echarts.baidu.com/)
2626
- [wakatime-API](https://wakatime.com/developers)
2727
- [ionic2-auth0](https://auth0.com/docs/quickstart/native/ionic2)

src/app/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {HomePage} from "../pages/home/home";
1313
})
1414
export class AuthApp {
1515
rootPage: any = WelcomePage;
16-
@ViewChild('myNav') nav: NavController
16+
@ViewChild('myNav') nav: NavController;
1717

1818
constructor(platform: Platform, public splashScreen: SplashScreen, public statusBar: StatusBar,
1919
private authService: AuthService,
@@ -29,7 +29,7 @@ export class AuthApp {
2929
}
3030
// Schedule a token refresh on app start up
3131
// auth.startupTokenRefresh();
32-
this.errorService.error$.subscribe((res) => {
32+
this.errorService.error$.distinctUntilChanged().subscribe((res) => {
3333
this.authService.isLoggedIn = false;
3434
this.presentToast();
3535
this.nav.setRoot(WelcomePage);

src/pages/home/home.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class HomePage {
7070
handler: () => {
7171
this.navCtrl.setRoot(WelcomePage);
7272
localStorage.removeItem('Authorization');
73-
this.apiService.delAuthorizationHeader();
73+
// this.apiService.delAuthorizationHeader();
7474
}
7575
}
7676
]

src/providers/api.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ export class ApiService {
166166
const body = error.json() || '';
167167
// const code = body.code;//错误码
168168
const err = body.error || JSON.stringify(body);
169+
console.log('err');
170+
console.log(error);
169171
this.errorService.updateError(err);
170172
errMsg = `${error.status} - ${error.statusText || ''} ${err}`;
171173
} else {

0 commit comments

Comments
 (0)