Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VCCI-News
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Văn Hoàng
VCCI-News
Commits
a7e94f8d
Commit
a7e94f8d
authored
Jun 16, 2026
by
Lê Bảo Hồng Đức
☄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tag]0.1-vcci
parent
7813ebcf
Pipeline
#50719
passed with stages
in 2 minutes and 45 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
route.ts
src/app/api/featured-members/route.ts
+1
-1
index.ts
src/links/index.ts
+35
-0
No files found.
src/app/api/featured-members/route.ts
View file @
a7e94f8d
import
{
NextResponse
}
from
"next/server"
;
import
{
NextResponse
}
from
"next/server"
;
const
FEATURED_MEMBER_API_URL
=
const
FEATURED_MEMBER_API_URL
=
"https://vccihcm.vn/api/v1.0/organizations?filters=users.status_id+%3D%3D+36ca1cc5-7b6e-4f9f-b973-69c5207deb62&pageSize=
9
&sortField=created_at&sortOrder=ASC"
;
"https://vccihcm.vn/api/v1.0/organizations?filters=users.status_id+%3D%3D+36ca1cc5-7b6e-4f9f-b973-69c5207deb62&pageSize=
12
&sortField=created_at&sortOrder=ASC"
;
export
async
function
GET
()
{
export
async
function
GET
()
{
try
{
try
{
...
...
src/links/index.ts
View file @
a7e94f8d
const
DEFAULT_BACKEND_ORIGIN
=
"https://news.vccihcm.vn"
;
const
DEFAULT_BACKEND_ORIGIN
=
"https://news.vccihcm.vn"
;
const
DEFAULT_FRONTEND_ORIGIN
=
"https://news.vccihcm.vn"
;
const
DEFAULT_FRONTEND_ORIGIN
=
"https://news.vccihcm.vn"
;
const
LEGACY_MEDIA_HOSTS
=
new
Set
([
"vietprodev.duckdns.org"
,
"vcci-hcm.org.vn"
,
"vccihcm.vn"
,
]);
const
normalizeOrigin
=
(
value
?:
string
|
null
)
=>
value
?.
trim
().
replace
(
/
\/
+$/
,
""
)
||
""
;
const
normalizeOrigin
=
(
value
?:
string
|
null
)
=>
value
?.
trim
().
replace
(
/
\/
+$/
,
""
)
||
""
;
const
extractUploadPath
=
(
pathname
:
string
)
=>
{
const
markers
=
[
"/api/uploads/"
,
"/uploads/"
,
"/wp-content/uploads/"
];
for
(
const
marker
of
markers
)
{
const
index
=
pathname
.
indexOf
(
marker
);
if
(
index
>=
0
)
{
const
cleanPath
=
pathname
.
slice
(
index
).
replace
(
/^
\/
api
\/
uploads
\/
/
,
"/uploads/"
);
return
cleanPath
;
}
}
return
null
;
};
const
readOrigin
=
(
key
:
"NEXT_PUBLIC_BACKEND_HOST"
|
"NEXT_PUBLIC_FRONTEND_HOST"
)
=>
{
const
readOrigin
=
(
key
:
"NEXT_PUBLIC_BACKEND_HOST"
|
"NEXT_PUBLIC_FRONTEND_HOST"
)
=>
{
const
envOrigin
=
normalizeOrigin
(
const
envOrigin
=
normalizeOrigin
(
key
===
"NEXT_PUBLIC_BACKEND_HOST"
key
===
"NEXT_PUBLIC_BACKEND_HOST"
...
@@ -61,6 +80,22 @@ export const resolveUploadUrl = (value?: string | null) => {
...
@@ -61,6 +80,22 @@ export const resolveUploadUrl = (value?: string | null) => {
return
trimmed
;
return
trimmed
;
}
}
if
(
/^https
?
:
\/\/
/i
.
test
(
trimmed
))
{
try
{
const
url
=
new
URL
(
trimmed
);
if
(
LEGACY_MEDIA_HOSTS
.
has
(
url
.
hostname
))
{
const
uploadPath
=
extractUploadPath
(
url
.
pathname
);
if
(
uploadPath
)
{
return
backendOrigin
?
`
${
backendOrigin
}${
uploadPath
}
`
:
uploadPath
;
}
}
}
catch
{
return
trimmed
;
}
return
trimmed
;
}
if
(
trimmed
.
startsWith
(
"/"
))
{
if
(
trimmed
.
startsWith
(
"/"
))
{
if
(
trimmed
.
startsWith
(
"/uploads/"
)
||
trimmed
.
startsWith
(
"/api/uploads/"
))
{
if
(
trimmed
.
startsWith
(
"/uploads/"
)
||
trimmed
.
startsWith
(
"/api/uploads/"
))
{
const
cleanPath
=
trimmed
.
replace
(
/^
\/
+/
,
""
).
replace
(
/^api
\/
uploads
\/
/
,
"uploads/"
);
const
cleanPath
=
trimmed
.
replace
(
/^
\/
+/
,
""
).
replace
(
/^api
\/
uploads
\/
/
,
"uploads/"
);
...
...
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