我想在重定向到登录之前显示一个祝酒词。就我而言,我的拦截器中有这段代码:
'use strict';
angular.module('frontEndApp')
.config(['$provide', '$httpProvider', function ($provide, $httpProvider,
$translate, toastr, CONST) {
$provide.factory('unauthorisedInterceptor', ['$q', function ($q) {
return {
'responseError': function (rejection) {
if (rejection.status === (401)) {
window.location.href = '/#/login';
}
if (rejection.status === (405)) {
window.location.href = '/#/login';
$translate('createsuccess')
.then(function (translatedMessage) {
toastr.success(translatedMessage, {
'timeOut': CONST.TOAST.timeOut,
'extendedTImeout': CONST.TOAST.extendedTImeout,
'progressBar': CONST.TOAST.progressBar,
'closeButton': CONST.TOAST.closeButton,
'showMethod': CONST.TOAST.showMethod,
'hideMethod': CONST.TOAST.slideUp
});
});
}
return $q.reject(rejection);
}
};
}]);
$httpProvider.interceptors.push('unauthorisedInterceptor');
}]);
我想向用户展示他们为什么重定向到登录页面...
你能帮帮我吗,烤面包机没有出现。