提交 c2edcf09 编写于 作者: 张平's avatar 张平

Merge branch 'dev-nav-20200319' into 'release'

Dev nav 20200319 导航权限设置代码合并

codereviewer:ping.zhang

See merge request !1
...@@ -6,10 +6,10 @@ export const envConfig = { ...@@ -6,10 +6,10 @@ export const envConfig = {
// baseUrl: 'https://dev-sc.yunqueyi.com/', // baseUrl: 'https://dev-sc.yunqueyi.com/',
// // baseUrl: 'http://10.177.15.180:10202/', // // baseUrl: 'http://10.177.15.180:10202/',
// // baseUrl: 'http://192.168.140.14:10201/', // // baseUrl: 'http://192.168.140.14:10201/',
// baseUrl: 'https://test1-sc.yunqueyi.com/', // baseUrl: 'https://test1-sc.yunqueyi.com/',
//baseUrl: 'https://uat-sc.yunqueyi.com/', //baseUrl: 'https://uat-sc.yunqueyi.com/',
baseUrl: 'https://dev-sc.yunqueyi.com/', baseUrl: 'https://uat-sc.yunqueyi.com/',
qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1", qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com", qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com", qiniuImgUrl: "https://test1-file.yunqueyi.com",
...@@ -48,7 +48,7 @@ export const envConfig = { ...@@ -48,7 +48,7 @@ export const envConfig = {
yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html', yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html',
excelUrl: 'https://uat-sc.yunqueyi.com/raytheon/excel/template/1', excelUrl: 'https://uat-sc.yunqueyi.com/raytheon/excel/template/1',
}, },
pro: { pro: {
baseUrl: 'https://sc.yunqueyi.com/', baseUrl: 'https://sc.yunqueyi.com/',
qiniuFileUrl: "https://sc.yunqueyi.com/contents/admin/qiniu/token1", qiniuFileUrl: "https://sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://video.yunqueyi.com", qiniuResourceUrl: "https://video.yunqueyi.com",
......
...@@ -69,14 +69,7 @@ export default { ...@@ -69,14 +69,7 @@ export default {
}, },
handleCommand(command) { handleCommand(command) {
if (command === 'logout') { if (command === 'logout') {
// let req = {token: localStorage.getItem("storageToken")}; sessionStorage.removeItem('PROT_CENTER_NAVS')
// let logOutPromise = vm.removeToken(req);
// logOutPromise.then(function (res) {
// logout();
// }).catch(function (error) {
// console.log('登出失败:'+error);
// logout();
// });
localStorage.removeItem('storageToken') localStorage.removeItem('storageToken')
if(vm.idType == 1) { // 内部 if(vm.idType == 1) { // 内部
window.location.href = getInnerLoginUrl() window.location.href = getInnerLoginUrl()
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
router router
> >
<template v-for="(item,_index) in items"> <template v-for="(item,_index) in items">
<template v-if="item.subs"> <template v-if="item.subs && item.subs.length">
<el-submenu :index=" 'index_' + _index" :key="item.index"> <el-submenu :index=" 'index_' + _index" :key="item.index">
<template slot="title"> <template slot="title">
<i :class="item.icon"></i> <i :class="item.icon"></i>
...@@ -47,38 +47,8 @@ export default { ...@@ -47,38 +47,8 @@ export default {
}, },
data() { data() {
return { return {
items: [ items: []
// { // items: [{ title: '协议管理', icon: 'el-icon-history-push', index: 'protocol-list' }]
// title: "黑名单",
// icon: "el-icon-blacklist",
// index: "blacklist"
// },
// {
// title: "疲劳度控制",
// icon: "el-icon-set-up",
// index: "fatigue-control"
// },
{
title: "协议管理",
icon: "el-icon-history-push",
index: "protocol-list"
},
// {
// title: "创建协议",
// icon: "el-icon-document-add",
// index: "create-protocol"
// },
// {
// title: "查看协议",
// icon: "el-icon-chat-line-square",
// index: "protocol-detail"
// },
// {
// title: "历史版本",
// icon: "el-icon-chat-line-square",
// index: "protocol-history"
// }
]
}; };
}, },
computed: { computed: {
...@@ -88,24 +58,46 @@ export default { ...@@ -88,24 +58,46 @@ export default {
}, },
created() { created() {
vm = this; vm = this;
const navs = sessionStorage.getItem('PROT_CENTER_NAVS');
vm.getNav();
}, },
watch: { watch: {},
// authList(newVal, oldVal) { methods: {
// if (!newVal.P001) { getNav() {
// // 项目管理 this.POST('basic-data/menu/list', { systemType: 29 }).then(res => {
// vm.items[1].subs[1].index = "blank"; if (res.code == '000000') {
// } const { vueMenuDtos } = res.data;
// if (!newVal.P002) {
// // 组件管理 this.items = vueMenuDtos;
// vm.items[1].subs[0].index = "blank"; sessionStorage.setItem('PROT_CENTER_NAVS', JSON.stringify(vueMenuDtos));
// } // 做当前路由无权限时处理
// if (!newVal.P003) { this.checkAuth(this.$route.path.split('/')[1], vueMenuDtos);
// // 角色管理 }
// vm.items[2].subs[0].index = "blank"; });
// } },
// } checkAuth(path, navs) {
}, let navList = getNavs(navs);
methods: {}
function getNavs(arr) {
let nvs = [];
for (let i = 0; i < arr.length; i++) {
const nav = arr[i];
const subs = nav.subs;
if (subs.length) {
nvs = nvs.concat(getNavs(subs));
} else {
nvs.push(nav.index);
}
}
return nvs;
}
if (navList.indexOf(path) == -1) {
this.$router.push(`/${navList[0]}`);
}
}
}
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册