Chapter 4: Error Handling, Authentication, and Route Protection
We need to implement error handling and security measures in our interfaces to ensure that the quality and user experience of the application is good.
In this chapter, we'll modify the login page created in Chapter 1, Environment Setup and Introduction to UmiJS and configure the default HTML template for our application. You'll learn how to store and globally access data by configuring your application's initial state. Next, you'll learn how to block unauthorized access using the Umi plugin-access
. Finally, you'll learn how to handle HTTP error responses and display feedback messages by configuring Umi requests.
In this chapter, we'll cover the following main topics:
- Modifying the login page and defining the HTML template
- Storing and globally accessing user information
- Protecting application routes based on user roles
- Handling HTTP error responses
By the end...