Files
ssw-mvp/web
admin 48ef4765e7 fix(portal): middleware 兼容 query string (/ssw/tds/?redirect=... 命中门户页)
根因: 苏苏访问 /ssw/tds/?redirect=... 时 vite middleware 未命中 (旧正则 $ 要求 URL
精确以 /ssw/tds/ 结尾, query 干扰), 落到 SPA fallback 返回 jweb SPA 入口 HTML (4559),
浏览器启动 jweb SPA 后 router 守卫 'if (!userStore.userInfo) return LOGIN_PATH',
把用户重定向到 /login?redirect=... 双重 URL 编码原 URL.

修复: 正则改成 /^\/ssw/(tds|tdc|sswflow)\/?(\?|$)/, 允许结尾是 ? 或 $;
非捕获组 (?:\?|$) 改成捕获组 (\?|$) 让 $1 能引用 ?.
replace: u.replace(/\/?(\?|$)/, '/index.html$1'), query 透传到 index.html.

验证: /ssw/tds/, /ssw/tds/?redirect=..., /ssw/tds/?foo=bar, /ssw/tds/index.html
四个 URL 两栈都 200 + 50169 bytes 命中 jweb 真源门户页.
2026-08-08 09:19:42 +08:00
..
2026-08-05 18:29:12 +08:00
2026-08-05 18:29:12 +08:00
2026-08-05 18:29:12 +08:00
2026-08-05 18:29:12 +08:00
2026-08-05 18:29:12 +08:00