|
@@ -1,5 +1,4 @@
|
|
|
import axios from 'axios';
|
|
import axios from 'axios';
|
|
|
-import { API_BASE_URL } from './index.ts';
|
|
|
|
|
import type {
|
|
import type {
|
|
|
LoginLocation, LoginLocationDetail,
|
|
LoginLocation, LoginLocationDetail,
|
|
|
} from '../../share/types.ts';
|
|
} from '../../share/types.ts';
|
|
@@ -30,7 +29,7 @@ export const MapAPI = {
|
|
|
userId?: number
|
|
userId?: number
|
|
|
}): Promise<LoginLocationResponse> => {
|
|
}): Promise<LoginLocationResponse> => {
|
|
|
try {
|
|
try {
|
|
|
- const response = await axios.get(`${API_BASE_URL}/map/markers`, { params });
|
|
|
|
|
|
|
+ const response = await axios.get(`/map/markers`, { params });
|
|
|
return response.data;
|
|
return response.data;
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
throw error;
|
|
throw error;
|
|
@@ -40,7 +39,7 @@ export const MapAPI = {
|
|
|
// 获取登录位置详情
|
|
// 获取登录位置详情
|
|
|
getLocationDetail: async (locationId: number): Promise<LoginLocationDetailResponse> => {
|
|
getLocationDetail: async (locationId: number): Promise<LoginLocationDetailResponse> => {
|
|
|
try {
|
|
try {
|
|
|
- const response = await axios.get(`${API_BASE_URL}/map/location/${locationId}`);
|
|
|
|
|
|
|
+ const response = await axios.get(`/map/location/${locationId}`);
|
|
|
return response.data;
|
|
return response.data;
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
throw error;
|
|
throw error;
|
|
@@ -54,7 +53,7 @@ export const MapAPI = {
|
|
|
location_name?: string;
|
|
location_name?: string;
|
|
|
}): Promise<LoginLocationUpdateResponse> => {
|
|
}): Promise<LoginLocationUpdateResponse> => {
|
|
|
try {
|
|
try {
|
|
|
- const response = await axios.put(`${API_BASE_URL}/map/location/${locationId}`, data);
|
|
|
|
|
|
|
+ const response = await axios.put(`/map/location/${locationId}`, data);
|
|
|
return response.data;
|
|
return response.data;
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
throw error;
|
|
throw error;
|