更新VSCode配置,启用Maven支持,设置Java 17环境,调整MybatisPlusSaasConfig以开启系统租户控制并添加新租户表。更新pom.xml以包含新模块jeecg-module-xslmes,优化Vue3环境配置以统一API路径,增强代理设置以支持完整的后端路径。修复useForm钩子中的字段重置逻辑,改进axios配置以处理相对URL的上下文路径问题。

This commit is contained in:
geht
2026-04-21 13:41:05 +08:00
parent 73426a7af3
commit 1b06e987dc
114 changed files with 8249 additions and 17 deletions

View File

@@ -20,12 +20,30 @@ export function createProxy(list: ProxyList = []) {
for (const [prefix, target] of list) {
const isHttps = httpsRE.test(target);
// 若 target 带路径(如 http://localhost:8080/jeecg-boot需拼回转发路径
// 否则 rewrite 去掉 /jeecgboot 后只剩 /xslmes/...,缺少 context-path后端会报 No static resource。
let proxyTarget = target;
let targetPathPrefix = '';
try {
const u = new URL(target);
const p = (u.pathname || '').replace(/\/$/, '');
if (p) {
targetPathPrefix = p;
proxyTarget = `${u.protocol}//${u.host}`;
}
} catch {
/* 非标准 URL 时保持原 target */
}
// https://github.com/http-party/node-http-proxy#options
ret[prefix] = {
target: target,
target: proxyTarget,
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(new RegExp(`^${prefix}`), ''),
rewrite: (path) => {
const stripped = path.replace(new RegExp(`^${prefix}`), '');
return targetPathPrefix ? `${targetPathPrefix}${stripped}` : stripped;
},
// https is require secure=false
...(isHttps ? { secure: false } : {}),
};