修改数据存储地点

master
wangdong 6 months ago
parent 666bc28630
commit 9bf76847dd
  1. 2
      src/layouts/BasicLayout.vue
  2. 2
      src/permission.js
  3. 3
      src/store/modules/permission.js
  4. 4
      src/views/goods/Index.vue
  5. 4
      src/views/goods/Update.vue
  6. 4
      src/views/manage/role/Index.vue
  7. 4
      src/views/manage/role/modules/EditForm.vue
  8. 4
      src/views/order/Index.vue

@ -135,7 +135,7 @@ export default {
Api.info().then(result => {
const { data: { storeInfo } } = result
this.storeInfo = storeInfo
window.storeInfo = storeInfo
window.localStorage.setItem('storeInfo', JSON.stringify(storeInfo))
})
},

@ -44,7 +44,7 @@ router.beforeEach((to, from, next) => {
store
.dispatch('GetInfo')
.then(({ roles, modules }) => {
window.roles = roles
window.localStorage.setItem('roles', JSON.stringify(roles));
// 根据roles权限生成可访问的路由表
store.dispatch('GenerateRoutes', { roles, modules })
.then(routers => {

@ -79,7 +79,6 @@ function filterModulesRouter (routerMap, modules) {
if (route.children && route.children.length) {
route.children = filterModulesRouter(route.children, modules)
}
console.log(route, route.moduleKey || '', modules)
return checkModuleKey(route, modules) && checkModules(route, modules)
})
return moduleRouters
@ -152,7 +151,7 @@ function setPrimaryMenuRedirect (routerMap) {
* 设置默认的首页
* @param {*} routerMap
*/
function setIndexRedirect (routerMap) {
function setIndexRedirect(routerMap) {
const root = routerMap[0]
if (root.children && root.children.length) {
const item = root.children[0]

@ -364,10 +364,10 @@ export default {
}
},
isSuper() {
return window.roles ? window.roles.isSuper : 0
return window.localStorage.getItem('roles') ? JSON.parse(window.localStorage.getItem('roles')).isSuper : 0
},
storeVersion() {
return window.storeInfo ? window.storeInfo.store_version : 0
return window.localStorage.getItem('storeInfo') ? JSON.parse(window.localStorage.getItem('storeInfo')).store_version : 0
}
},
methods: {

@ -597,10 +597,10 @@ export default {
},
computed: {
isSuper() {
return window.roles ? window.roles.isSuper : 0
return window.localStorage.getItem('roles') ? JSON.parse(window.localStorage.getItem('roles')).isSuper : 0
},
storeVersion() {
return window.storeInfo ? window.storeInfo.store_version : 0
return window.localStorage.getItem('storeInfo') ? JSON.parse(window.localStorage.getItem('storeInfo')).store_version : 0
}
},
watch: {

@ -84,10 +84,10 @@ export default {
},
computed: {
isSuper() {
return window.roles ? window.roles.isSuper : 0
return window.localStorage.getItem('roles') ? JSON.parse(window.localStorage.getItem('roles')).isSuper : 0
},
storeVersion() {
return window.storeInfo ? window.storeInfo.store_version : 0
return window.localStorage.getItem('storeInfo') ? JSON.parse(window.localStorage.getItem('storeInfo')).store_version : 0
}
},
created () {

@ -102,10 +102,10 @@ export default {
},
computed: {
isSuper() {
return window.roles ? window.roles.isSuper : 0
return window.localStorage.getItem('roles') ? JSON.parse(window.localStorage.getItem('roles')).isSuper : 0
},
storeVersion() {
return window.storeInfo ? window.storeInfo.store_version : 0
return window.localStorage.getItem('storeInfo') ? JSON.stringify(window.localStorage.getItem('storeInfo')).store_version : 0
}
},
methods: {

@ -360,10 +360,10 @@ export default {
},
computed: {
isSuper() {
return window.roles ? window.roles.isSuper : 0
return window.localStorage.getItem('roles') ? JSON.parse(window.localStorage.getItem('roles')).isSuper : 0
},
storeVersion() {
return window.storeInfo ? window.storeInfo.store_version : 0
return window.localStorage.getItem('storeInfo') ? JSON.parse(window.localStorage.getItem('storeInfo')).store_version : 0
}
},
watch: {

Loading…
Cancel
Save