fix(dev-server): proxy /sso/did/pub to txw-cloud gateway (BUG-D)

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' 截走,
再次落到生产。
This commit is contained in:
liulong 2026-06-07 14:59:01 +08:00
parent 3189873e54
commit b984406b86

View File

@ -294,6 +294,15 @@ module.exports = {
target: 'http://localhost:8080', target: 'http://localhost:8080',
changeOrigin: true, changeOrigin: true,
}, },
'^/sso/did/pub': {
// 阶段 2 BUG-Dlogin.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': { '^/sso': {
// target: 'http://localhost:9300', // target: 'http://localhost:9300',
// target: 'http://carbon.liantu.tech', // target: 'http://carbon.liantu.tech',