Browse Source

Merge branch 'master' of ssh://101.201.226.163:50022/binbin0314/datang-admin

master
aBin 3 years ago
parent
commit
a6738ddf8d
  1. 13
      src/App.vue
  2. 3
      src/components/Detail/editor.vue
  3. 2
      src/router/index.js
  4. 4
      src/router/modules/privilegeManagement.js

13
src/App.vue

@ -10,28 +10,35 @@ export default {
name: 'App',
watch: {
$route(to){
const path = `/${to.path.split('/')[1]}`
this.setCode(path)
$route(to, from) {
if(to.name){
const arr = to.path.split('/')
const path = `/${arr[arr.length-1]}`
this.setCode(path)
}
}
},
methods: {
setCode(path) {
console.log('path: ', path);
router.options.routes.forEach(first => {
if(first && first.path && first.path === path){
console.log('first.code: ',first, first.code);
localStorage.setItem('code', first.code)
return;
}else{
if(first.children && first.children.length){
first.children.forEach(second => {
if(second && second.path && second.path === path){
console.log('second.code: ', second.code);
localStorage.setItem('code', second.code)
return;
}else{
if(second.children && second.children.length){
second.children.forEach(third => {
if(third && third.path && third.path === path){
console.log('third.code: ', third.code);
localStorage.setItem('code', third.code)
return;
}

3
src/components/Detail/editor.vue

@ -4,7 +4,8 @@
<script>
import {BASE_API} from '../../config';
import E from './wangEditor.min.js'
import E from 'wangEditor'
// import E from './wangEditor.min.js'
export default {
name: 'editoritem',
props:{

2
src/router/index.js

@ -22,7 +22,7 @@ export const constantRoutes = [
},
{
path: '/',
redirect: '/privilegeManagement/account'
redirect: '/privilegeManagement1'
},
require("./modules/privilegeManagement.js").default,
require("./menus/index.js").default,

4
src/router/modules/privilegeManagement.js

@ -7,14 +7,14 @@ const commodityManagement = {
meta: {title: '权限管理', icon: 'shouquanguanli', noCache: true, affix: false},
children: [
{
path: '/privilegeManagement/account',
path: '/privilegeManagement1',
component: () => import('@/views/privilegeManagement/account/index'),
name: '账户管理',
code: '6601',
meta: {title: '账户管理', noCache: false, affix: false}
},
{
path: '/privilegeManagement/role',
path: '/privilegeManagement2',
component: () => import('@/views/privilegeManagement/role/index'),
name: '角色管理',
code: '6602',

Loading…
Cancel
Save