|
@@ -331,24 +331,19 @@ const actions = {
|
|
|
commit('setCurrentLevel', level)
|
|
|
//获取公司列表(区分超管和普通账户api)
|
|
|
const api = isSupertube ? requsetSupertubeCompany : requsetUserBindingCompany
|
|
|
-
|
|
|
//获取缓存里的业务公司 => 公司名称搜索 => 存在设置为默认公司
|
|
|
const { data: companyData, code: companyCode } = await api({
|
|
|
...(!isSupertube ? ({size: 10000}) : {type: '1'}),
|
|
|
...({token: getToken()}),
|
|
|
})
|
|
|
-
|
|
|
//保存公司列表 普通用户和超管使用两个列表需要转换
|
|
|
let _companylist = []
|
|
|
if(companyCode === 0) {
|
|
|
_companylist = isSupertube ? companyData.list : convertCompanylist(companyData.list);
|
|
|
-
|
|
|
//超管 + 业务公司 需要将 relation_code 设置为 code
|
|
|
if(isSupertube) _companylist = _companylist.map(item => ({...item, code: item.relation_code}))
|
|
|
-
|
|
|
commit('setCompanylist', _companylist)
|
|
|
}
|
|
|
-
|
|
|
if(companyCode >= 100 && companyCode <= 104){
|
|
|
resolve("noToken")
|
|
|
return
|
|
@@ -457,7 +452,6 @@ async function getRoleProcess(roleid) {
|
|
|
return sii;
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
return si;
|
|
|
});
|
|
|
return {
|
|
@@ -467,74 +461,73 @@ async function getRoleProcess(roleid) {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
-function isHasRoute(routes){
|
|
|
- let isHas = false
|
|
|
- const chunks = location.hash.split('/')
|
|
|
- const currentPath = chunks[chunks.length - 1]
|
|
|
-
|
|
|
- const dfs = (routes) => {
|
|
|
- routes.forEach(route => {
|
|
|
- if(route.path === currentPath) isHas = true;
|
|
|
- if(route.children && route.children.length > 0) dfs(route.children)
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- dfs([
|
|
|
- {
|
|
|
- path: "/person",
|
|
|
- component: () => import("@/layout/index"),
|
|
|
- redirect: "/person/my-message",
|
|
|
- hidden: true,
|
|
|
- alwaysShow: true,
|
|
|
- meta: {
|
|
|
- title: "个人中心",
|
|
|
- icon: "user",
|
|
|
- },
|
|
|
- children: [
|
|
|
- {
|
|
|
- path: "my-message",
|
|
|
- component: () => import("@/views/person-infor/my-message"),
|
|
|
- name: "MyMessage",
|
|
|
- alwaysShow: true,
|
|
|
- meta: { title: "我的信息", noCache: true, breadcrumb: true },
|
|
|
- },
|
|
|
- {
|
|
|
- path: "change-phone",
|
|
|
- component: () => import("@/views/person-infor/change-phone"),
|
|
|
- name: "ChangePhone",
|
|
|
- alwaysShow: true,
|
|
|
- meta: { title: "更换手机号", noCache: true, breadcrumb: true },
|
|
|
- },
|
|
|
- {
|
|
|
- path: "change-password",
|
|
|
- component: () => import("@/views/person-infor/change-password"),
|
|
|
- name: "ChangePassword",
|
|
|
- alwaysShow: true,
|
|
|
- meta: { title: "修改密码", noCache: true, breadcrumb: true },
|
|
|
- },
|
|
|
- {
|
|
|
- path:'/reload',
|
|
|
- component:() => import('@/views/reload/index')
|
|
|
- }
|
|
|
- ],
|
|
|
- },
|
|
|
- //欢迎页
|
|
|
- {
|
|
|
- path: "/welcome",
|
|
|
- component: () => import("@/layout/index"),
|
|
|
- redirect: "/welcome/dashboard",
|
|
|
- children: [
|
|
|
- {
|
|
|
- path: "dashboard",
|
|
|
- component: () => import("@/views/dashboard/index"),
|
|
|
- name: "Dashboard",
|
|
|
- meta: { title: "首页", icon: "dashboard", affix: true },
|
|
|
- },
|
|
|
- ],
|
|
|
- },...routes])
|
|
|
-
|
|
|
- return isHas
|
|
|
-}
|
|
|
+// function isHasRoute(routes){
|
|
|
+// let isHas = false
|
|
|
+// const chunks = location.hash.split('/')
|
|
|
+// const currentPath = chunks[chunks.length - 1]
|
|
|
+
|
|
|
+// const dfs = (routes) => {
|
|
|
+// routes.forEach(route => {
|
|
|
+// if(route.path === currentPath) isHas = true;
|
|
|
+// if(route.children && route.children.length > 0) dfs(route.children)
|
|
|
+// })
|
|
|
+// }
|
|
|
+
|
|
|
+// dfs([
|
|
|
+// {
|
|
|
+// path: "/person",
|
|
|
+// component: () => import("@/layout/index"),
|
|
|
+// redirect: "/person/my-message",
|
|
|
+// hidden: true,
|
|
|
+// alwaysShow: true,
|
|
|
+// meta: {
|
|
|
+// title: "个人中心",
|
|
|
+// icon: "user",
|
|
|
+// },
|
|
|
+// children: [
|
|
|
+// {
|
|
|
+// path: "my-message",
|
|
|
+// component: () => import("@/views/person-infor/my-message"),
|
|
|
+// name: "MyMessage",
|
|
|
+// alwaysShow: true,
|
|
|
+// meta: { title: "我的信息", noCache: true, breadcrumb: true },
|
|
|
+// },
|
|
|
+// {
|
|
|
+// path: "change-phone",
|
|
|
+// component: () => import("@/views/person-infor/change-phone"),
|
|
|
+// name: "ChangePhone",
|
|
|
+// alwaysShow: true,
|
|
|
+// meta: { title: "更换手机号", noCache: true, breadcrumb: true },
|
|
|
+// },
|
|
|
+// {
|
|
|
+// path: "change-password",
|
|
|
+// component: () => import("@/views/person-infor/change-password"),
|
|
|
+// name: "ChangePassword",
|
|
|
+// alwaysShow: true,
|
|
|
+// meta: { title: "修改密码", noCache: true, breadcrumb: true },
|
|
|
+// },
|
|
|
+// {
|
|
|
+// path:'/reload',
|
|
|
+// component:() => import('@/views/reload/index')
|
|
|
+// }
|
|
|
+// ],
|
|
|
+// },
|
|
|
+// //欢迎页
|
|
|
+// {
|
|
|
+// path: "/welcome",
|
|
|
+// component: () => import("@/layout/index"),
|
|
|
+// redirect: "/welcome/dashboard",
|
|
|
+// children: [
|
|
|
+// {
|
|
|
+// path: "dashboard",
|
|
|
+// component: () => import("@/views/dashboard/index"),
|
|
|
+// name: "Dashboard",
|
|
|
+// meta: { title: "首页", icon: "dashboard", affix: true },
|
|
|
+// },
|
|
|
+// ],
|
|
|
+// },...routes])
|
|
|
+// return isHas
|
|
|
+// }
|
|
|
|
|
|
// 区分供应商和业务公司获取不同的菜单列表
|
|
|
async function getRoleMenuList(level = "") {
|
|
@@ -595,8 +588,8 @@ async function getRoleMenuList(level = "") {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- const isHas = isHasRoute(arrag)
|
|
|
- if(!isHas) router.push('/welcome/dashboard')
|
|
|
+ // const isHas = isHasRoute(arrag)
|
|
|
+ // if(!isHas) router.push('/welcome/dashboard')
|
|
|
|
|
|
return {
|
|
|
mcode: code,
|