|
|
|
@ -31,21 +31,25 @@ const permission = {
|
|
|
|
|
state.sidebarRouters = routes;
|
|
|
|
|
},
|
|
|
|
|
SET_INTEGRAL: (state, integral) => {
|
|
|
|
|
console.log(integral, "aaaa");
|
|
|
|
|
state.integral = integral;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
actions: {
|
|
|
|
|
FindIntegralData({ commit }) {
|
|
|
|
|
let integral = getFindIntegral();
|
|
|
|
|
commit("SET_INTEGRAL", integral);
|
|
|
|
|
getFindIntegral().then((integral) => {
|
|
|
|
|
commit("SET_INTEGRAL", integral);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 生成路由
|
|
|
|
|
GenerateRoutes({ commit }) {
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
let integral = getFindIntegral();
|
|
|
|
|
commit("SET_INTEGRAL", integral);
|
|
|
|
|
// 向后端请求路由数据
|
|
|
|
|
getRouters().then((res) => {
|
|
|
|
|
getFindIntegral().then((integral) => {
|
|
|
|
|
commit("SET_INTEGRAL", integral);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const sdata = JSON.parse(JSON.stringify(res.data));
|
|
|
|
|
const rdata = JSON.parse(JSON.stringify(res.data));
|
|
|
|
|
const sidebarRoutes = filterAsyncRouter(sdata);
|
|
|
|
|