Mike há 7 anos atrás
pai
commit
b62c1cc70a

+ 3 - 4
miaomiao/www/js/services/httpinterceptor.js

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

+ 1 - 1
miaomiao/www/templates/account/login.html

xqd
@@ -25,7 +25,7 @@
             </div>
         </div>
         <button type="submit" ng-click="login()" class="button button-block button-calm" style="border-radius: 50px;">
-                登 录1
+                登 录
         </button>
         <div  class="lglogin">
             <span style="font-size: 15px; color: #E1E1E1">- 社交媒体登录 -</span>