Commit 1ab9d213 by Nattana Chaiyamat

แก้โหลดตัวอย่างExcel

parent 493dc671
...@@ -19,7 +19,9 @@ export class HttpRequestInterceptor { ...@@ -19,7 +19,9 @@ export class HttpRequestInterceptor {
constructor(private tokenService: TokenService, private authService: AuthService) { } constructor(private tokenService: TokenService, private authService: AuthService) { }
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (req.url.startsWith("./")) { if (req.url.startsWith('/assets/')) {
return next.handle(req);
} else if (req.url.startsWith("./")) {
return next.handle(req); return next.handle(req);
} else { } else {
let authReq = req; let authReq = req;
...@@ -37,9 +39,9 @@ export class HttpRequestInterceptor { ...@@ -37,9 +39,9 @@ export class HttpRequestInterceptor {
if (fullUrl.includes("login")) { if (fullUrl.includes("login")) {
return next.handle(this.addTokenHeader(req, "Bearer ", fullUrl)) return next.handle(this.addTokenHeader(req, "Bearer ", fullUrl))
} else if (error instanceof HttpErrorResponse && error.status === 401 && !fullUrl.includes("login")) { } else if (error instanceof HttpErrorResponse && error.status === 401 && !fullUrl.includes("login")) {
if(fullUrl.includes("/refresh-token")&& error.status === 401){ if (fullUrl.includes("/refresh-token") && error.status === 401) {
this.tokenService.signOut(); this.tokenService.signOut();
}else{ } else {
this.isRefreshing = false; this.isRefreshing = false;
return this.handle401Error(authReq, next, fullUrl); return this.handle401Error(authReq, next, fullUrl);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment