代码规范性调整
This commit is contained in:
@@ -21,7 +21,7 @@ export const dictionary = {
|
||||
if (res.code === 0) {
|
||||
const dictionaryMap = {}
|
||||
const dict = []
|
||||
res.data.resysDictionary.sysDictionaryDetails && res.data.resysDictionary.sysDictionaryDetails.map(item => {
|
||||
res.data.resysDictionary.sysDictionaryDetails && res.data.resysDictionary.sysDictionaryDetails.forEach(item => {
|
||||
dict.push({
|
||||
label: item.label,
|
||||
value: item.value
|
||||
|
||||
@@ -5,7 +5,7 @@ import { asyncMenu } from '@/api/menu'
|
||||
const routerList = []
|
||||
|
||||
const formatRouter = (routes) => {
|
||||
routes && routes.map(item => {
|
||||
routes && routes.forEach(item => {
|
||||
if ((!item.children || item.children.every(ch => ch.hidden)) && item.name !== '404' && !item.hidden) {
|
||||
routerList.push({ label: item.meta.title, value: item.name })
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { login, getUserInfo } from '@/api/user'
|
||||
import { login, getUserInfo, setUserInfo } from '@/api/user'
|
||||
import { jsonInBlacklist } from '@/api/jwt'
|
||||
import router from '@/router/index'
|
||||
import { setUserInfo } from '@/api/user'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
export const user = {
|
||||
@@ -45,7 +44,7 @@ export const user = {
|
||||
...userInfo
|
||||
}
|
||||
},
|
||||
ChangeSideMode: async(state, val) => {
|
||||
ChangeSideMode: (state, val) => {
|
||||
state.userInfo.sideMode = val
|
||||
},
|
||||
},
|
||||
@@ -64,7 +63,7 @@ export const user = {
|
||||
commit('setToken', res.data.token)
|
||||
await dispatch('router/SetAsyncRouter', {}, { root: true })
|
||||
const asyncRouters = rootGetters['router/asyncRouters']
|
||||
asyncRouters.map(asyncRouter => {
|
||||
asyncRouters.forEach(asyncRouter => {
|
||||
router.addRoute(asyncRouter)
|
||||
})
|
||||
// const redirect = router.history.current.query.redirect
|
||||
|
||||
Reference in New Issue
Block a user