You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

131 lines
2.9 KiB

import db from '@/utils/localstorage'
export default {
namespaced: true,
state: {
accessToken: db.get('ACCESS_TOKEN'),
refreshToken: db.get('REFRESH_TOKEN'),
token: db.get('TOKEN', ''),
expireTime: db.get('EXPIRE_TIME', 0),
user: db.get('USER'),
permissions: db.get('PERMISSIONS') || [],
// routes: db.get('USER_ROUTER') || []
routes: [
{
path: '/management',
name: '商家管理',
meta: {
title: '商家管理',
icon: 'el-icon-office-building'
},
children: [
{
path: '/management',
meta: {
title: '商家列表'
}
},
{
path: '/apply',
meta: {
title: '入驻申请'
}
}
]
},
{
path: '/',
meta: {
title: '平台装修',
icon: 'el-icon-box'
},
children: [
{
path: '/applet',
meta: {
title: '小程序',
icon: 'el-icon-s-shop'
}
},
{
path: '/custom',
meta: {
title: '自定义页面',
icon: 'el-icon-edit-outline'
}
},
{
path: '/classification',
meta: {
title: '商品类别',
icon: 'el-icon-s-order'
}
}
]
},
{
path: '/marketing',
name: '营销活动',
meta: {
title: '营销活动',
icon: 'el-icon-s-ticket'
}
},
{
path: '/finance',
meta: {
title: '财务',
icon: 'el-icon-coin'
},
children: [
{
path: '/finance/cash',
name: '提现申请',
meta: {
title: '提现申请',
icon: 'el-icon-s-finance'
}
},
{
path: '/finance/cash-deposit',
name: '保证金',
meta: {
title: '保证金',
icon: 'el-icon-money'
}
}
]
}
]
},
mutations: {
setAccessToken(state, val) {
db.save('ACCESS_TOKEN', val)
state.accessToken = val
},
setRefreshToken(state, val) {
db.save('REFRESH_TOKEN', val)
state.refreshToken = val
},
setToken(state, val) {
db.save('TOKEN', val)
state.token = val
},
setExpireTime(state, val) {
db.save('EXPIRE_TIME', val)
state.expireTime = val
},
setUser(state, val) {
db.save('USER', val)
state.user = val
},
setPermissions(state, val) {
db.save('PERMISSIONS', val)
state.permissions = val
},
setRoutes(state, val) {
db.save('USER_ROUTER', val)
state.routes = val
}
}
}