How heeexy/springboot-shiro-vue works
• Backend Service: Represent the Spring Boot application. Break this down further by explaining:
– Application Entry and Core Configuration: Highlight MyApplication.java and configuration classes (like CacheConfig and Exception Handling – GlobalExceptionHandler, etc.).
– Security & Permission System: Emphasize the use of custom annotations (@RequiresPermissions, Logical annotations) and AOP aspects (such as PermissionAspect and filters like RequestFilter and WebLogAspect) to implement permission verification.
– Controllers and Services: Note the separation between controllers (ArticleController, LoginController, UserController), service layers (ArticleService, LoginService, TokenService, UserService), DAOs, and data transfer objects (DTOs).
• External Interactions / Client-Server Communication: Show API endpoints that the Vue frontend calls on the Spring Boot backend. Emphasize token-based authentication (where the backend returns a token with permission data, as described in the sample JSON) instead of traditional sessions.
Relationships and Interactions
• The Vue frontend issuing REST API calls to the backend (for login, fetching permissions, data operations such as list/add/delete for articles/users).
• The backend’s internal flow: Controllers receive requests, invoke service logic, and interact with DAOs to access the database.
• The security workflow: How a login request results in a token being issued, which is then validated on subsequent API calls via custom annotation processing.
• Data flow for permission information: once the user logs in, the backend returns user permission data (menuList and permissionList), which then drives dynamic routing and UI rendering in the frontend.
Specific Technologies and Frameworks
• Backend: Java, Spring Boot, Maven (pom.xml), Shiro-inspired permission annotations, AOP, Spring’s exception handling, YAML configurations for different environments (application-prod.yml, etc.).
• Frontend: Vue.js, ElementUI, vue-router, Vuex for state management, and the vueAdmin-template approach for dynamic routing and permission filtering.
• Other: Database (as configured by db.sql and mapper XML files), along with build and configuration tools (e.g., Webpack for Vue).
Specific Elements
• Clear labels (use “Frontend (Vue)”, “Backend (Spring Boot)”, “Database”).
• API request/response flow,
• Data flow when fetching permission data after login,
• Internal calls between controllers, services, and DAOs.
• Annotations to identify cross-cutting components such as the PermissionAspect, RequestFilter, or other aspects.