chongtu
parent
6e737a3fa7
commit
7cd64553ab
|
@ -3,10 +3,14 @@ var BASE = {
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
API_DEV: {
|
API_DEV: {
|
||||||
common: "http://localhost:8890",
|
// common: "http://localhost:8890",
|
||||||
buyer: "http://localhost:8888",
|
// buyer: "http://localhost:8888",
|
||||||
seller: "http://localhost:8889",
|
// seller: "http://localhost:8889",
|
||||||
manager: "http://localhost:8887"
|
// manager: "http://localhost:8887"
|
||||||
|
common:"http://192.168.0.113:8890",
|
||||||
|
buyer:"http://192.168.0.113:8888",
|
||||||
|
manager:"http://192.168.0.113:8887",
|
||||||
|
seller:"http://192.168.0.113:8889"
|
||||||
},
|
},
|
||||||
API_PROD: {
|
API_PROD: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
|
|
|
@ -27,12 +27,6 @@ export const getHomeNotice = params => {
|
||||||
return getRequest("/other/article/getByPage?type=STORE_ARTICLE&pageSize=15");
|
return getRequest("/other/article/getByPage?type=STORE_ARTICLE&pageSize=15");
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取全部权限数据
|
|
||||||
export const getCurrentPermissionList = (params) => {
|
|
||||||
return getRequest("/menu/memberMenu", params);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// 登陆
|
// 登陆
|
||||||
export const getSellerHomeData = params => {
|
export const getSellerHomeData = params => {
|
||||||
return getRequest("/statistics/index", params);
|
return getRequest("/statistics/index", params);
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { getCurrentPermissionList } from "@/api/index";
|
||||||
import lazyLoading from './lazyLoading.js';
|
import lazyLoading from './lazyLoading.js';
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import { result } from './routerJson.js';
|
import { result } from './routerJson.js';
|
||||||
import { getCurrentPermissionList } from "@/api/index";
|
|
||||||
|
|
||||||
const config = require('@/config/index')
|
const config = require('@/config/index')
|
||||||
|
|
||||||
|
@ -331,18 +330,19 @@ util.initRouter = function (vm) { // 初始化路由
|
||||||
if (!vm.$store.state.app.added) {
|
if (!vm.$store.state.app.added) {
|
||||||
// 加载菜单
|
// 加载菜单
|
||||||
getCurrentPermissionList().then(res => {
|
getCurrentPermissionList().then(res => {
|
||||||
console.log(res)
|
|
||||||
if (!res.success) return false;
|
if (!res.success) return false;
|
||||||
let menuData = res.result;
|
let menuData = result;
|
||||||
|
|
||||||
|
|
||||||
// 格式化数据,设置 空children 为 null
|
// 格式化数据,设置 空children 为 null
|
||||||
for (let i = 0; i < menuData.length; i++) {
|
for (let i = 0; i < menuData.length; i++) {
|
||||||
let t = menuData[i].children
|
let t = menuData[i].children;
|
||||||
for (let k = 0; k < t.length; k++) {
|
for (let k = 0; k < t.length; k++) {
|
||||||
let tt = t[k].children;
|
let tt = t[k].children;
|
||||||
for (let z = 0; z < tt.length; z++) {
|
for (let z = 0; z < tt.length; z++) {
|
||||||
tt[z].children = null
|
tt[z].children = null;
|
||||||
// 给所有三级路由添加字段,显示一级菜单name,方便点击页签时的选中筛选
|
// 给所有三级路由添加字段,显示一级菜单name,方便点击页签时的选中筛选
|
||||||
tt[z].firstRouterName = menuData[i].name
|
tt[z].firstRouterName = menuData[i].name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -352,15 +352,19 @@ util.initRouter = function (vm) { // 初始化路由
|
||||||
util.initAllMenuData(constRoutes, menuData);
|
util.initAllMenuData(constRoutes, menuData);
|
||||||
util.initRouterNode(otherRoutes, otherRouter);
|
util.initRouterNode(otherRoutes, otherRouter);
|
||||||
// 添加所有主界面路由
|
// 添加所有主界面路由
|
||||||
vm.$store.commit('updateAppRouter', constRoutes.filter(item => item.children.length > 0));
|
vm.$store.commit(
|
||||||
|
"updateAppRouter",
|
||||||
|
constRoutes.filter(item => item.children.length > 0)
|
||||||
|
);
|
||||||
// 添加全局路由
|
// 添加全局路由
|
||||||
vm.$store.commit('updateDefaultRouter', otherRoutes);
|
vm.$store.commit("updateDefaultRouter", otherRoutes);
|
||||||
// 添加菜单路由
|
// 添加菜单路由
|
||||||
util.initMenuData(vm, menuData);
|
util.initMenuData(vm, menuData);
|
||||||
// 缓存数据 修改加载标识
|
// 缓存数据 修改加载标识
|
||||||
window.localStorage.setItem('menuData', JSON.stringify(menuData));
|
window.localStorage.setItem("menuData", JSON.stringify(menuData));
|
||||||
vm.$store.commit('setAdded', true);
|
vm.$store.commit("setAdded", true);
|
||||||
})
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 读取缓存数据
|
// 读取缓存数据
|
||||||
let data = window.localStorage.getItem('menuData');
|
let data = window.localStorage.getItem('menuData');
|
||||||
|
|
Loading…
Reference in New Issue