feat: 五项目业务实现并对接完成
- MES(B): 工单/BOM/备料/工序字典/PLC下发/拧紧/扫码报工/半成品/AGV/追溯逻辑,WMS与海康RCS客户端,看板Redis缓存API(概览/设备/进度/报警/趋势)+SSE - WMS(C): JWT滑动续签、Excel导入、盘点、内部API、种子数据、独立Postgres配置 - WMS客户端(E): Go网关8891反向代理+内嵌Vue3十页 - 工位终端(D): SQLite本地缓存+模拟拧紧源+内嵌Vue3页面 - Dashboard(A): 看板数据改接MES内部缓存API,SSE实时刷新+vite代理 - 清理各项目球形磨遗留代码,新增部署手册.md
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import axios from 'axios';
|
||||
|
||||
// MES(B) 内部 API:X-API-TOKEN 写死 token(值与 MES etc 配置 Internal.Token 一致)
|
||||
export const MES_TOKEN =
|
||||
(import.meta as any).env?.VITE_MES_TOKEN || 'bj-power-internal-2026';
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: '/api/v1/dashboard',
|
||||
timeout: 10000,
|
||||
@@ -13,4 +17,19 @@ api.interceptors.response.use(
|
||||
},
|
||||
);
|
||||
|
||||
export default api;
|
||||
// 走 MES 内部接口(经 vite proxy 或 nginx 反代到 MES :8888)
|
||||
const mesApi = axios.create({
|
||||
baseURL: '/api/internal',
|
||||
timeout: 10000,
|
||||
headers: { 'X-API-TOKEN': MES_TOKEN },
|
||||
});
|
||||
|
||||
mesApi.interceptors.response.use(
|
||||
(res) => res,
|
||||
(err) => {
|
||||
console.error(`[MES API] ${err.message}`);
|
||||
return Promise.reject(err);
|
||||
},
|
||||
);
|
||||
|
||||
export { api as default, mesApi };
|
||||
|
||||
Reference in New Issue
Block a user