♻️ refactor: Refactor API endpoints to use dynamic API prefix from environment variables
- Updated all service files to replace hardcoded API paths with `${import.meta.env.VITE_API_PREFIX}` for better configurability.
- Ensured consistency across user, common, and gateway services by applying the new API prefix format.
- Removed unnecessary comments and maintained ESLint disable directives where applicable.
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
//
|
||||
/* eslint-disable */
|
||||
import request from "@workspace/ui/lib/request";
|
||||
|
||||
/** Query revenue statistics GET /v1/admin/console/revenue */
|
||||
export async function queryRevenueStatistics(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.RevenueStatisticsResponse }>(
|
||||
"/api/v1/admin/console/revenue",
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/console/revenue`,
|
||||
{
|
||||
method: "GET",
|
||||
...(options || {}),
|
||||
@@ -16,7 +15,7 @@ export async function queryRevenueStatistics(options?: { [key: string]: any }) {
|
||||
/** Query server total data GET /v1/admin/console/server */
|
||||
export async function queryServerTotalData(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.ServerTotalDataResponse }>(
|
||||
"/api/v1/admin/console/server",
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/console/server`,
|
||||
{
|
||||
method: "GET",
|
||||
...(options || {}),
|
||||
@@ -27,7 +26,7 @@ export async function queryServerTotalData(options?: { [key: string]: any }) {
|
||||
/** Query ticket wait reply GET /v1/admin/console/ticket */
|
||||
export async function queryTicketWaitReply(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.TicketWaitRelpyResponse }>(
|
||||
"/api/v1/admin/console/ticket",
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/console/ticket`,
|
||||
{
|
||||
method: "GET",
|
||||
...(options || {}),
|
||||
@@ -38,7 +37,7 @@ export async function queryTicketWaitReply(options?: { [key: string]: any }) {
|
||||
/** Query user statistics GET /v1/admin/console/user */
|
||||
export async function queryUserStatistics(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.UserStatisticsResponse }>(
|
||||
"/api/v1/admin/console/user",
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/console/user`,
|
||||
{
|
||||
method: "GET",
|
||||
...(options || {}),
|
||||
|
||||
Reference in New Issue
Block a user