Callback of vue website how to use official account to pay

when you pay for Wechat"s official account, you need to call the API to obtain the user"s code. You need to provide a callback url, to jump to url and add the parameters of the user"s code. For example, url is xxx.com/a.html, jump is xxx.com/a.html?code=123, but vue URL is xxx.com/-sharp/index?id=1 jump URL and write code directly after xxx.com/. The address is completely wrong.

now my plan is to modify the webpack configuration to make a multi-page entry, using one page exclusively for payment. Is there any way to write the logic on a routing page? Or is there any other better way? How do you all do it?


it seems that hashtag is not allowed in the callback address of Wechat.

A single-page application can change vue-router to history mode:
clipboard.png

at the same time, if it is a project deployed by nginx, you need to change the nginx configuration:

location / {
  try_files $uri $uri/ /index.html;
}
Menu