Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
307 views
in Technique[技术] by (71.8m points)

javascript - Redirect to vue front end from larvel backend

I am integrating a payment gateway and all the code are executed by the backend. I send a post request from the front end to backend and the payment process starts. After the payment is complete, I get a post request from the payment gateway to the backend with the payment info. Then I validate the payment and update the database. The next step is to redirect the user to the /success route of my vuejs project. Here is a scenario of my procedure.

  • My backend: backend.com
  • My front end: frontend.com
  • Payment request from front end to backend: backend.com/pay
  • Response url of the payment gateway to the backend: backend/success

I want to update the database and redirect my user to frontend.com/success with payment information when the payment is successful. I am using Laravel for backend and vuejs for front end.

question from:https://stackoverflow.com/questions/65893400/redirect-to-vue-front-end-from-larvel-backend

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After you send your POST request to the backend and receive a valid response, you can use Vue Router to redirect the user to the success page using $router.push('/success')


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...