Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mySkill-x
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
mySkill-x
Commits
1ab9d213
Commit
1ab9d213
authored
Jun 09, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
แก้โหลดตัวอย่างExcel
parent
493dc671
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
http-request.interceptor.ts
src/app/shared/services/http-request.interceptor.ts
+5
-3
No files found.
src/app/shared/services/http-request.interceptor.ts
View file @
1ab9d213
...
...
@@ -19,7 +19,9 @@ export class HttpRequestInterceptor {
constructor
(
private
tokenService
:
TokenService
,
private
authService
:
AuthService
)
{
}
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
);
}
else
{
let
authReq
=
req
;
...
...
@@ -37,9 +39,9 @@ export class HttpRequestInterceptor {
if
(
fullUrl
.
includes
(
"login"
))
{
return
next
.
handle
(
this
.
addTokenHeader
(
req
,
"Bearer "
,
fullUrl
))
}
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
();
}
else
{
}
else
{
this
.
isRefreshing
=
false
;
return
this
.
handle401Error
(
authReq
,
next
,
fullUrl
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment