mirror of
https://github.com/m1ngsama/FUJI.git
synced 2025-12-25 02:56:38 +00:00
20 lines
437 B
TypeScript
20 lines
437 B
TypeScript
import { SITE_URL } from "../../consts"
|
|
|
|
export const useGraduationIdURL = () => {
|
|
const idKey = "id"
|
|
|
|
const getId = () => {
|
|
return new URLSearchParams(window.location.search).get(idKey) as string | undefined
|
|
}
|
|
|
|
const constructURL = (id: string) => {
|
|
const url = new URL(`/graduation/download`, SITE_URL)
|
|
url.searchParams.append(idKey, id)
|
|
return url.toString()
|
|
}
|
|
|
|
return {
|
|
getId,
|
|
constructURL,
|
|
}
|
|
}
|