🐛 fix: update API prefix handling to ensure compatibility with undefined VITE_API_PREFIX
This commit is contained in:
@@ -8,7 +8,7 @@ export async function queryIpLocation(
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.QueryIPLocationResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/tool/ip/location`,
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/tool/ip/location`,
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
@@ -22,7 +22,7 @@ export async function queryIpLocation(
|
||||
/** Get System Log GET /v1/admin/tool/log */
|
||||
export async function getSystemLog(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.LogResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/tool/log`,
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/tool/log`,
|
||||
{
|
||||
method: "GET",
|
||||
...(options || {}),
|
||||
@@ -33,7 +33,7 @@ export async function getSystemLog(options?: { [key: string]: any }) {
|
||||
/** Restart System GET /v1/admin/tool/restart */
|
||||
export async function restartSystem(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/tool/restart`,
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/tool/restart`,
|
||||
{
|
||||
method: "GET",
|
||||
...(options || {}),
|
||||
@@ -44,7 +44,7 @@ export async function restartSystem(options?: { [key: string]: any }) {
|
||||
/** Get Version GET /v1/admin/tool/version */
|
||||
export async function getVersion(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.VersionResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/tool/version`,
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/tool/version`,
|
||||
{
|
||||
method: "GET",
|
||||
...(options || {}),
|
||||
|
||||
Reference in New Issue
Block a user