代码规范性调整

This commit is contained in:
蒋吉兆
2021-09-21 17:55:18 +08:00
parent 51e26a00a4
commit 2c06ca34c0
19 changed files with 32 additions and 33 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 })
}
+3 -4
View File
@@ -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