我有以下Spring代码......
@GetMapping("/error")
public String getError(HttpServletRequest request, HttpServletResponse response){
...
return "forward:/";
}
@GetMapping("")
String get( ){ return "index"; }
我的VueJS路由器看起来像这样......
const routes = [
{
path: '/',
component: Viewport,
children: [
{
path:'/',
component: Content
},
{
path:'/error',
component: Error
}
]
}
];
const router = new VueRouter({
mode: "history",
routes: routes
});
但现在我想传递这样的类型......
const routes = [
{
path: '/',
component: Viewport,
children: [
{
path:'/',
component: Content
},
{
path:'/error',
component: Error,
children: [
{
path:"/auth",
component: AuthError
}
]
}
]
}
];
因此,在这种情况下,网址应为/error/auth
。但我还想更进一步,并提供像/error/auth?message=blahblahblah
如何将这些值添加到URL?