使用" forward时如何设置参数:/"

时间:2018-06-06 21:16:21

标签: spring-mvc spring-boot vue.js forward

我有以下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?

0 个答案:

没有答案