1
This commit is contained in:
@@ -43,6 +43,10 @@ export const deviceApi = {
|
||||
heartbeat(payload: { username: string; deviceId: string; version?: string }) {
|
||||
return http.postVoid(`${base}/heartbeat`, payload)
|
||||
},
|
||||
|
||||
offline(payload: { deviceId: string }) {
|
||||
return http.postVoid(`${base}/offline`, payload)
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
export type HttpMethod = 'GET' | 'POST';
|
||||
|
||||
const BASE_CLIENT = 'http://localhost:8081'; // erp_client_sb
|
||||
const BASE_RUOYI = 'http://localhost:8080'; // ruoyi-admin
|
||||
const BASE_RUOYI = 'http://localhost:8080';
|
||||
|
||||
function resolveBase(path: string): string {
|
||||
if (path.startsWith('/tool/banma')) return BASE_RUOYI;
|
||||
// 走 ruoyi-admin 的路径:鉴权与版本、平台工具路由
|
||||
if (path.startsWith('/system/')) return BASE_RUOYI; // 版本控制器 VersionController
|
||||
if (path.startsWith('/tool/banma')) return BASE_RUOYI; // 既有规则保留
|
||||
// 其他默认走客户端服务
|
||||
return BASE_CLIENT;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ export interface BanmaAccount {
|
||||
id?: number;
|
||||
name?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
token?: string;
|
||||
tokenExpireAt?: string | number;
|
||||
isDefault?: number;
|
||||
@@ -53,12 +54,12 @@ export const zebraApi = {
|
||||
},
|
||||
|
||||
// 业务采集(仍走客户端微服务 8081)
|
||||
getShops() {
|
||||
getShops(params?: { accountId?: number }) {
|
||||
return http.get<{ data?: { list?: Array<{ id: string; shopName: string }> } }>(
|
||||
'/api/banma/shops'
|
||||
'/api/banma/shops', params as unknown as Record<string, unknown>
|
||||
);
|
||||
},
|
||||
getOrders(params: { startDate?: string; endDate?: string; page?: number; pageSize?: number; shopIds?: string }) {
|
||||
getOrders(params: { accountId?: number; startDate?: string; endDate?: string; page?: number; pageSize?: number; shopIds?: string }) {
|
||||
return http.get<ZebraOrdersResp>('/api/banma/orders', params as unknown as Record<string, unknown>);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user