|
@@ -31,14 +31,13 @@
|
|
},
|
|
},
|
|
'responseError': function (rejection) {
|
|
'responseError': function (rejection) {
|
|
// console.log(JSON.stringify(rejection));
|
|
// console.log(JSON.stringify(rejection));
|
|
- if (rejection.status == 401) {
|
|
|
|
|
|
+ if (rejection.status == 401||rejection.data.message=="Unauthenticated.") {
|
|
storage.remove('user');
|
|
storage.remove('user');
|
|
storage.remove('token');
|
|
storage.remove('token');
|
|
getHttp().defaults.headers.common["Authorization"] = undefined;
|
|
getHttp().defaults.headers.common["Authorization"] = undefined;
|
|
getState().go('login');
|
|
getState().go('login');
|
|
- // alert("not login");
|
|
|
|
- // return $q.reject(rejection);
|
|
|
|
- return;
|
|
|
|
|
|
+ alert("not login");
|
|
|
|
+ return $q.reject(rejection);
|
|
}
|
|
}
|
|
if (rejection.status == 400) {
|
|
if (rejection.status == 400) {
|
|
getMsg().error(rejection.data.message);
|
|
getMsg().error(rejection.data.message);
|