袁野 7 months ago
parent 1fd3ee1d6f
commit e2ad51442a
  1. 3
      src/app/app.routes.ts
  2. 1
      src/app/pages/system/menu/menu.component.ts
  3. 2
      src/app/utils/Interceptor.service.ts

@ -5,8 +5,7 @@ export const routes: Routes = [
{path: '', pathMatch: 'full', redirectTo: 'admin/index'}, {path: '', pathMatch: 'full', redirectTo: 'admin/index'},
{ {
path: 'login', path: 'login',
loadChildren: () => import('./pages/login/login.routes').then(m => m.LOGIN_ROUTES), loadChildren: () => import('./pages/login/login.routes').then(m => m.LOGIN_ROUTES)
canActivate: [InitGuardService]
}, },
{ {
path: 'admin', component: IndexComponent, path: 'admin', component: IndexComponent,

@ -24,7 +24,6 @@ import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; import {NzInputNumberComponent} from "ng-zorro-antd/input-number";
import {NzMessageService} from "ng-zorro-antd/message"; import {NzMessageService} from "ng-zorro-antd/message";
import {DATA} from "../../../data/login/localStorage.namespace";
@Component({ @Component({
selector: 'app-menu', selector: 'app-menu',

@ -23,6 +23,8 @@ export class InterceptorService implements HttpInterceptor {
const token = this.storage.get(USER_TOKEN); const token = this.storage.get(USER_TOKEN);
if (token != null) { if (token != null) {
modifiedHeaders = req.headers.set('Authorization', token); modifiedHeaders = req.headers.set('Authorization', token);
modifiedHeaders = req.headers.set( 'Cache-Control', 'no-cache',)
modifiedHeaders = req.headers.set( 'Pragma', 'no-cache',)
} }
secureReq = req.clone({ secureReq = req.clone({

Loading…
Cancel
Save