From a073ac4b2de154731d06cee6d8bfe510ff22241f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E5=90=89=E5=85=86?= <303176530@qq.com> Date: Tue, 21 Sep 2021 17:55:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83=E6=80=A7?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/permission.js | 2 +- web/src/store/module/dictionary.js | 2 +- web/src/store/module/router.js | 2 +- web/src/store/module/user.js | 7 +++---- web/src/utils/asyncRouter.js | 2 +- web/src/view/example/breakpoint/breakpoint.vue | 2 +- web/src/view/example/customer/customer.vue | 4 ++-- web/src/view/layout/aside/index.vue | 2 +- web/src/view/superAdmin/api/api.vue | 2 +- web/src/view/superAdmin/authority/authority.vue | 2 +- web/src/view/superAdmin/authority/components/apis.vue | 6 +++--- web/src/view/superAdmin/authority/components/datas.vue | 6 +++--- web/src/view/superAdmin/authority/components/menus.vue | 2 +- web/src/view/superAdmin/dictionary/sysDictionary.vue | 2 +- .../view/superAdmin/dictionary/sysDictionaryDetail.vue | 2 +- web/src/view/superAdmin/menu/menu.vue | 2 +- web/src/view/superAdmin/operation/sysOperationRecord.vue | 4 ++-- web/src/view/superAdmin/user/user.vue | 6 +++--- web/src/view/systemTools/autoCode/index.vue | 8 ++++---- 19 files changed, 32 insertions(+), 33 deletions(-) diff --git a/web/src/permission.js b/web/src/permission.js index 91caab56..51747d0d 100644 --- a/web/src/permission.js +++ b/web/src/permission.js @@ -9,7 +9,7 @@ const getRouter = async() => { await store.dispatch('router/SetAsyncRouter') await store.dispatch('user/GetUserInfo') const asyncRouters = store.getters['router/asyncRouters'] - asyncRouters.map(asyncRouter => { + asyncRouters.forEach(asyncRouter => { router.addRoute(asyncRouter) }) } diff --git a/web/src/store/module/dictionary.js b/web/src/store/module/dictionary.js index 533d206d..b71c2248 100644 --- a/web/src/store/module/dictionary.js +++ b/web/src/store/module/dictionary.js @@ -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 diff --git a/web/src/store/module/router.js b/web/src/store/module/router.js index 5f22b76d..e16f50df 100644 --- a/web/src/store/module/router.js +++ b/web/src/store/module/router.js @@ -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 }) } diff --git a/web/src/store/module/user.js b/web/src/store/module/user.js index 9ce95768..8f321c76 100644 --- a/web/src/store/module/user.js +++ b/web/src/store/module/user.js @@ -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 diff --git a/web/src/utils/asyncRouter.js b/web/src/utils/asyncRouter.js index 97eed4a3..ecd66563 100644 --- a/web/src/utils/asyncRouter.js +++ b/web/src/utils/asyncRouter.js @@ -1,7 +1,7 @@ const modules = import.meta.glob('../view/**/*.vue') export const asyncRouterHandle = (asyncRouter) => { - asyncRouter.map(item => { + asyncRouter.forEach(item => { if (item.component) { item.component = dynamicImport(modules, item.component) } else { diff --git a/web/src/view/example/breakpoint/breakpoint.vue b/web/src/view/example/breakpoint/breakpoint.vue index e58754cd..fa588732 100644 --- a/web/src/view/example/breakpoint/breakpoint.vue +++ b/web/src/view/example/breakpoint/breakpoint.vue @@ -127,7 +127,7 @@ export default { }, sliceFile() { this.waitUpLoad && - this.waitUpLoad.map(item => { + this.waitUpLoad.forEach(item => { // 需要上传的切片 item.formData.append('chunkTotal', this.formDataList.length) // 切片总数携带给后台 总有用的 const fileR = new FileReader() // 功能同上 diff --git a/web/src/view/example/customer/customer.vue b/web/src/view/example/customer/customer.vue index bfaaca5f..5e5c7343 100644 --- a/web/src/view/example/customer/customer.vue +++ b/web/src/view/example/customer/customer.vue @@ -23,7 +23,7 @@