Add server selection page

Add a new page for server selection and update backend URL handling.

* **ServerSelection.vue**: Create a new Vue component with a form to input and save the backend server URL to `localStorage`. Add methods to handle form submission and load the saved URL on component mount.
* **index.vue**: Update the `data` method to retrieve the backend URL from `localStorage`. Remove the hardcoded `backurl` value. Add a method to update the backend URL from `localStorage` on component mount. Update API requests to use the dynamic backend URL.
* **router/index.js**: Add a new route for the `ServerSelection` component.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/SunWuyuan/homeworkpage-frontend?shareId=XXXX-XXXX-XXXX-XXXX).
This commit is contained in:
孙悟元
2024-11-24 08:55:05 +08:00
parent 8c30232ece
commit 58e286d80b
3 changed files with 56 additions and 1 deletions
+10
View File
@@ -34,3 +34,13 @@ router.isReady().then(() => {
})
export default router
import ServerSelection from '@/pages/ServerSelection.vue'
const routes = [
{
path: '/server-selection',
name: 'ServerSelection',
component: ServerSelection,
},
]