首页 > 解决方案 > Laravel vue 重定向到组件

问题描述

我是 vue js 的新手。

当请求 axios 发布到控制器时,它应该将重定向返回到同一组件。在我的方法中,我可以看到它在 borwser 下的网络面板中返回,我可以在预览部分看到它。但它应该在浏览器上工作。

catch (IncompletePayment $exception) {
            if($exception->payment->status === 'requires_action'){
                return redirect()->route(
                    'cashier.payment',
                    [$exception->payment->id, 'redirect'=>route('payment')]
                );
            }

            return response()->json(['message' => $exception->payment->status, 'type'=>'stripe_error'], 206);
        }

我的网络路线是这样的:

Route::get('/pay',function(){
   return view('app');
})->name('payment');

Route::any('/{any}', function (){
    return view('app');
})->where('any', '.*');

Auth::routes();

图像显示返回

标签: laravelvue.jsroutesvue-router

解决方案


推荐阅读