Commit fcccc14a authored by 李苏's avatar 李苏 💬

动态存取

parent 93bf10c2
...@@ -27,3 +27,12 @@ export function systeminfo(query) { ...@@ -27,3 +27,12 @@ export function systeminfo(query) {
data: query||{} data: query||{}
}) })
} }
// 公司接口
export function queryGs(query) {
return request({
url: '/jcsj/common/bm/queryGs',
method: 'post',
data: query||{}
})
}
...@@ -24,8 +24,14 @@ export default { ...@@ -24,8 +24,14 @@ export default {
type: Boolean, type: Boolean,
required: true required: true
} }
},
watch:{
}, },
computed: { computed: {
title(){
return $store.state.permission.appName
},
variables() { variables() {
return variables; return variables;
}, },
...@@ -34,7 +40,8 @@ export default { ...@@ -34,7 +40,8 @@ export default {
} }
}, },
mounted(){ mounted(){
this.title=localStorage.getItem('appName')
// this.title=this.$store.state.permission.appName
}, },
data() { data() {
return { return {
......
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
const state = { const state = {
isInit:false, isInit:false,
sidebar: { sidebar: {
opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
...@@ -12,6 +13,7 @@ const state = { ...@@ -12,6 +13,7 @@ const state = {
} }
const mutations = { const mutations = {
changeInit:state=>{ changeInit:state=>{
state.isInit=true state.isInit=true
}, },
......
...@@ -13,9 +13,13 @@ const permission = { ...@@ -13,9 +13,13 @@ const permission = {
addRoutes: [], addRoutes: [],
defaultRoutes: [], defaultRoutes: [],
topbarRouters: [], topbarRouters: [],
sidebarRouters: [] sidebarRouters: [],
appName:'',
}, },
mutations: { mutations: {
SET_APPNAME:(state,appName)=>{
state.appName=appName
},
SET_SIDEBAR_SHOW:(state, menusBizType)=>{ SET_SIDEBAR_SHOW:(state, menusBizType)=>{
state.sidebarRouters.forEach((e,index)=>{ state.sidebarRouters.forEach((e,index)=>{
if(menusBizType!='root'&&e.menusBizType&&e.menusBizType==menusBizType){ if(menusBizType!='root'&&e.menusBizType&&e.menusBizType==menusBizType){
...@@ -79,7 +83,9 @@ const permission = { ...@@ -79,7 +83,9 @@ const permission = {
getRouters({}).then(res => { getRouters({}).then(res => {
let appName=res.data.appName||'' let appName=res.data.appName||''
commit('SET_APPNAME', appName)
localStorage.setItem('appName',appName) localStorage.setItem('appName',appName)
let menus=res.data.menu let menus=res.data.menu
let asymenus=JSON.parse(JSON.stringify(res.data.menu)) let asymenus=JSON.parse(JSON.stringify(res.data.menu))
/* 权限路由*/ /* 权限路由*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment