Once made a function to cancel the order. This function is available in the personal center and on the order details page. According to the normal idea, the two parts can be submitted to the same action for processing, but the returned pages are different. They can all be returned to the current page. Simply put, on the personal Center page, the customer clicks to cancel the order, submits the order to an action, performs database operations, and changes the field values in a table, then return to the personal Center page again, but the "cancel" button is changed to the gray "canceled" button, and the Order details page is the same, submit to the same acion, but the return page is not the personal Center page, but the order details page.
In this case, you can use js to save the current path, write it to the cookie, and obtain the path in acion. By using the get/set method, you only need Write the el expression of the path.
The Code is as follows:
The Code is as follows: