Angular 角度和网页包中的URL重写问题

Angular 角度和网页包中的URL重写问题,angular,webpack,proxy,session-state-provider,Angular,Webpack,Proxy,Session State Provider,我的网址如下:- 我想使用我的linkname(这是一个动态名称,可以是任何名称),例如: abc.com/dinesh abc.com/anyname 它适用于所有情况,除了 如果用户传递后缀为/的任意名称。例: abc.com/anyname/ 它失败了,返回abc.com。我的代码如下: .state('otherwise', { url: '/:link', middleware: ['routerMiddleware'] }); devServer: { proxy

我的网址如下:-

我想使用我的linkname(这是一个动态名称,可以是任何名称),例如:

abc.com/dinesh abc.com/anyname

它适用于所有情况,除了

如果用户传递后缀为/的任意名称。例:

abc.com/anyname/

它失败了,返回abc.com。我的代码如下:

.state('otherwise', {
  url: '/:link',
  middleware: ['routerMiddleware']
});
 devServer: {
    proxy: {
      '!/**/*.*/': {
        target: 'http://localhost:8082/',
        pathRewrite: {
          '^/.*': ''
        }
      }
    }
  },
Angular v1状态提供程序代码如下:

.state('otherwise', {
  url: '/:link',
  middleware: ['routerMiddleware']
});
 devServer: {
    proxy: {
      '!/**/*.*/': {
        target: 'http://localhost:8082/',
        pathRewrite: {
          '^/.*': ''
        }
      }
    }
  },
我正在使用webpack版本1。代码如下:

.state('otherwise', {
  url: '/:link',
  middleware: ['routerMiddleware']
});
 devServer: {
    proxy: {
      '!/**/*.*/': {
        target: 'http://localhost:8082/',
        pathRewrite: {
          '^/.*': ''
        }
      }
    }
  },
这对我来说很好:-

.state('otherwise', {
  url: '*link',
  middleware: ['routerMiddleware']
});
这对我来说很好:-

.state('otherwise', {
  url: '*link',
  middleware: ['routerMiddleware']
});
也为我工作。(+1),你能添加一些描述吗?它将在将来帮助其他人。也为我工作。(+1),你能添加一些描述吗?它将在将来帮助其他人。