中化项目-边缘主机维护-前端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
473 B

import { Component } from '@angular/core';
import { CacheTokenService } from './service/cache-token.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
constructor(public token: CacheTokenService) { }
ngOnInit() {
if (sessionStorage.getItem('token') && !this.token.timer) {
//调用服务中的function刷新token
this.token.startUp()
}
}
}