This is not a scaffolding project, but a basic demo project, stripped of the actual business reference project. Create a new Vue backend project, which can be modified based on this project.
Use Mockjs to simulate interface data (to be improved)
axios implements network requests (subsequent encapsulation and unified error handling)
vuex state management
Routing permission control
Online Demo
Username:admin
Password:123456
Loginable users are in ${root_project}/src/mock/data/exampleData.js
For global Vuex state management, please refer to the configuration in src/vuex/modules/control.js. All asynchronous requests share one action and three fixed mutation methods.
As for Vuex's state management, it is written in the callback of the method in the Vue template, so that code can be shared and a large number of similar codes can be avoided.
All network requests also share the same axios.request() method. The request type and success callback are all passed into the request in the form of parameters, which also avoids a large number of similar codes.
For comparison with the reference case, please view the login request called and the request to obtain the employee list in employee management.
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
For detailed explanation on how things work, checkout the guide and docs for vue-loader.