From b984406b8691720706ba2ddb5f3bc2362d614656 Mon Sep 17 00:00:00 2001 From: liulong <18539103286> Date: Sun, 7 Jun 2026 14:59:01 +0800 Subject: [PATCH] fix(dev-server): proxy /sso/did/pub to txw-cloud gateway (BUG-D) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit login.vue 的 DID 扫码登录轮询(每 2s 一次)打 GET /sso/did/pub/backresult/login?reqId=xxx 查扫码结果。 老栈 target = https://www.cciw.com.cn (生产), 本地的 reqId 在生产查不到,cookie 里的 admin/admin123 也跟 生产不匹配,结果轮询一直返回"密码错误"。 跟 BUG-C 一样的修法:vue.config.js 新增 '^/sso/did/pub' 代理 (target = http://localhost:8080, pathRewrite: /sso/did/pub -> /auth/did/pub), 把请求改写到新栈 8080 gateway 的 /auth/did/pub/**。nacos 白名单里 这个接口是开放的。 这条规则必须放在 '^/sso' 之前,否则会被广匹配的 '^/sso' 截走, 再次落到生产。 --- txw-mhzc-web/vue.config.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/txw-mhzc-web/vue.config.js b/txw-mhzc-web/vue.config.js index 580dd58..c2f5e32 100644 --- a/txw-mhzc-web/vue.config.js +++ b/txw-mhzc-web/vue.config.js @@ -294,6 +294,15 @@ module.exports = { target: 'http://localhost:8080', changeOrigin: true, }, + '^/sso/did/pub': { + // 阶段 2 BUG-D:login.vue 的 DID 扫码轮询(每 2s 一次)打 /sso/did/pub/backresult/login, + // 老栈 target 是 cciw.com.cn 生产,本地 reqId/cookie 校验失败会一直返回"密码错误"。 + // 新栈 nacos 白名单有 /auth/did/pub/**,把 /sso/did/pub/** 改写到 8080 的 /auth/did/pub/**。 + // 必须放在 '^/sso' 之前,否则会被广匹配的 '^/sso' 截走。 + target: 'http://localhost:8080', + changeOrigin: true, + pathRewrite: { '^/sso/did/pub': '/auth/did/pub' }, + }, '^/sso': { // target: 'http://localhost:9300', // target: 'http://carbon.liantu.tech',