Tencent / TSW

Tencent Server Web
https://tswjs.org/
Other
1.81k stars 184 forks source link

全息日志未展开时无法看到请求路径 #544

Closed 7Finn closed 1 year ago

7Finn commented 1 year ago

如图: image image

在未展开时只有 /,但展开后是能看到详细路径的。 静态数据可以,但POST请求不行 image

tswconfig.js

const OpenPlatformPlugin = require('@tswjs/open-platform-plugin');
const uinRegEx = /.../;

module.exports = {
  plugins: [
    new OpenPlatformPlugin({
      reportStrategy: 'proxied',
      getUid: (req) => {
        const { cookie } = req.headers;
        if (!cookie) return;
        return (cookie.match(uinRegEx) || [])[1] || '';
      },
      getProxyInfo: () => ({
        port: 80,
        name: '..',
        group: '..',
        groupName: '...',
        desc: '..',
        order: 30,
        alphaOnly: process.env.NODE_ENV !== 'test',
        alphaList: [
        ],
      }),
    }),
  ],
};

APP_ID: tsw2104 用户Uid: 879788904 时间:2023-03-23 17:30~17:50 nodejs: 14.15.0 node框架: express@4.17.1 @tswjs/tsw: 2.6.4

RobinzZH commented 1 year ago

已沟通确认,这是express修改了req.url导致的,业务可自行兼容