Client App

This commit is contained in:
Donald Zou
2025-08-16 12:27:50 +08:00
parent 1867db5c99
commit 430a6053ef
4 changed files with 49 additions and 49 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -28,7 +28,7 @@
} }
} }
</style> </style>
<script type="module" crossorigin src="/static/client/dist/assets/index-DMoJJGnR.js"></script> <script type="module" crossorigin src="/static/client/dist/assets/index-Cun74Xi8.js"></script>
<link rel="stylesheet" crossorigin href="/static/client/dist/assets/index-tn8r-uDQ.css"> <link rel="stylesheet" crossorigin href="/static/client/dist/assets/index-tn8r-uDQ.css">
</head> </head>
<body> <body>

View File

@@ -6,7 +6,7 @@ export const requestURl = (url) => {
: `${window.location.protocol}//${(window.location.host + window.location.pathname + url).replace(/\/\//g, '/')}` : `${window.location.protocol}//${(window.location.host + window.location.pathname + url).replace(/\/\//g, '/')}`
} }
const router = useRouter() // const router = useRouter()
export const axiosPost = async (URL, body = {}) => { export const axiosPost = async (URL, body = {}) => {
try{ try{
@@ -14,9 +14,9 @@ export const axiosPost = async (URL, body = {}) => {
return res.data return res.data
} catch (error){ } catch (error){
console.log(error) console.log(error)
if (error.status === 401){ // if (error.status === 401){
await router.push('/signin') // await router.push('/signin')
} // }
return undefined return undefined
} }
@@ -28,9 +28,9 @@ export const axiosGet = async (URL, query = {}) => {
return res.data return res.data
} catch (error){ } catch (error){
console.log(error) console.log(error)
if (error.status === 401){ // if (error.status === 401){
await router.push('/signin') // await router.push('/signin')
} // }
return undefined return undefined
} }
} }