{"remainingRequest":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\eslint-loader\\index.js??ref--13-0!D:\\jenkins\\workspace\\cqlt-fvue\\src\\router.js","dependencies":[{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\src\\router.js","mtime":1689659933864},{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\cqlt-fvue\\node_modules\\eslint-loader\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.string.starts-with\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.regexp.search\";\nimport _toConsumableArray from \"D:/jenkins/workspace/cqlt-fvue/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport Vue from 'vue';\nimport Router from 'vue-router';\nimport store from '@/store';\nimport NotFound from '@/views/NotFound.vue';\nimport Login from '@/views/Login.vue';\nimport req from '@/request.js';\nimport uc from '@/api/uc.js';\nimport { Message } from 'element-ui';\nimport { Loading } from 'element-ui'; //路由\n\nimport mainRouter from '@/module_router.js';\nimport Layout from '@/components/layout/Layout.vue';\nVue.use(Router);\nvar router = new Router({\n mode: 'history',\n base: process.env.BASE_URL,\n routes: [{\n path: '/',\n redirect: {\n name: 'login'\n }\n }, {\n path: '/login',\n name: 'login',\n component: Login,\n meta: {\n single: true,\n anonymous: true\n }\n }, {\n path: '/resetPwdView',\n name: 'resetPwdView',\n props: true,\n component: function component() {\n return import('@/views/ResetPwdView.vue');\n },\n meta: {\n single: true,\n anonymous: true\n }\n }, {\n path: '*',\n component: NotFound,\n meta: {\n single: true\n }\n },\n /* 大屏看板 */\n //财务\n {\n path: '/financialTheme',\n name: 'financialTheme',\n component: function component() {\n return import('@/views/BigScrenn/financialTheme.vue');\n }\n },\n /*集团*/\n {\n path: '/group',\n name: 'group',\n component: function component() {\n return import('@/views/BigScrenn/group.vue');\n }\n },\n /*企业*/\n {\n path: '/enterprise',\n name: 'enterprise',\n component: function component() {\n return import('@/views/BigScrenn/enterprise.vue');\n }\n }, //一级下撰\n {\n path: '/firstLevelPage',\n name: 'firstLevelPage',\n component: function component() {\n return import('@/views/BigScrenn/components/firstLevelPage.vue');\n }\n }, //二级下撰\n {\n path: '/secondLevelPage',\n name: 'secondLevelPage',\n component: function component() {\n return import('@/views/BigScrenn/components/secondLevelPage.vue');\n }\n }, //三级下撰\n {\n path: '/thirdLevelPage',\n name: 'thirdLevelPage',\n component: function component() {\n return import('@/views/BigScrenn/components/thirdLevelPage.vue');\n }\n }, //四级下撰\n {\n path: '/fourthLevelPage',\n name: 'fourthLevelPage',\n component: function component() {\n return import('@/views/BigScrenn/components/fourthLevelPage.vue');\n }\n }, //数据分析\n {\n path: '/moreDialog',\n name: 'moreDialog',\n component: function component() {\n return import('@/views/BigScrenn/components/moreDialog.vue');\n }\n },\n /*资金*/\n {\n path: '/fundTheme',\n name: 'fundTheme',\n component: function component() {\n return import('@/views/BigScrenn/fundTheme/index.vue');\n }\n }, //一级下撰\n {\n path: '/fundFirstPage',\n name: 'fundFirstPage',\n component: function component() {\n return import('@/views/BigScrenn/fundTheme/components/fundFirstPage.vue');\n }\n }, //二级下撰\n {\n path: '/fundSecondPage',\n name: 'fundSecondPage',\n component: function component() {\n return import('@/views/BigScrenn/fundTheme/components/fundSecondPage.vue');\n }\n }, //三级下撰\n {\n path: '/fundThirdPage',\n name: 'fundThirdPage',\n component: function component() {\n return import('@/views/BigScrenn/fundTheme/components/fundThirdPage.vue');\n }\n }, //四级下撰\n {\n path: '/fundFourthPage',\n name: 'fundFourthPage',\n component: function component() {\n return import('@/views/BigScrenn/fundTheme/components/fundFourthPage.vue');\n }\n }, //数据分析\n {\n path: '/fundMoreDialog',\n name: 'fundMoreDialog',\n component: function component() {\n return import('@/views/BigScrenn/fundTheme/components/fundMoreDialog.vue');\n }\n }, //周资金下撰\n {\n path: '/weeklyfundSuPage',\n name: 'weeklyfundSuPage',\n component: function component() {\n return import('@/views/BigScrenn/fundTheme/components/weeklyfundSuPage.vue');\n }\n },\n /*运营*/\n {\n path: '/operationTheme',\n name: 'operationTheme',\n component: function component() {\n return import('@/views/BigScrenn/operationTheme/index.vue');\n }\n }, //下撰\n {\n path: '/operationTheme/writeDownPage',\n name: 'writeDownPage',\n component: function component() {\n return import('@/views/BigScrenn/operationTheme/components/writeDownPage.vue');\n }\n },\n /*投资*/\n {\n path: '/investmentTheme',\n name: 'investmentTheme',\n component: function component() {\n return import('@/views/BigScrenn/investmentTheme/index.vue');\n }\n },\n /*人资*/\n {\n path: '/humanResourceTheme',\n name: 'humanResourceTheme',\n component: function component() {\n return import('@/views/BigScrenn/humanResourceTheme/index.vue');\n }\n }, //下撰\n {\n path: '/humanResourceTheme/writeDownPage',\n name: 'writeDownPage',\n component: function component() {\n return import('@/views/BigScrenn/humanResourceTheme/components/writeDownPage.vue');\n }\n },\n /*综合*/\n {\n path: '/comprehensiveTheme',\n name: 'comprehensiveTheme',\n component: function component() {\n return import('@/views/BigScrenn/comprehensiveTheme/index.vue');\n }\n }, {\n path: '/business',\n name: 'business',\n component: function component() {\n return import('@/views/Business.vue');\n }\n }, {\n path: '/platLayout',\n name: 'platLayout',\n component: Layout,\n meta: {\n single: true,\n anonymous: true\n },\n children: [{\n path: 'PersonalInfo',\n name: 'PersonalInfoInner',\n props: true,\n component: function component() {\n return import('@/views/PersonalInfo.vue');\n }\n }, {\n path: 'resetPwdView',\n name: 'resetPwdViewInner',\n props: true,\n component: function component() {\n return import('@/views/ResetPwdView.vue');\n }\n }].concat(_toConsumableArray(mainRouter))\n }]\n});\n\nvar createRouter = function createRouter() {\n return new Router({\n mode: 'history',\n routes: []\n });\n}; //重写动态添加路由方法\n\n\nrouter.$addRoutes = function (params) {\n var newRouter = createRouter();\n router.matcher = newRouter.matcher; //重置路由规则\n\n router.addRoutes(params); // 添加路由\n}; //动态新增二级路由\n\n\nrouter.addList = function (path, list) {\n var isAddPath = false;\n var isChildren = false;\n return isChildren;\n};\n\nvar registerRouteFresh = true;\n\nvar ssoRedirect = function ssoRedirect() {\n if (window.ssoConfig.mode == 'cas') {\n var service = window.location.href;\n localStorage.setItem('service', service);\n window.location.href = window.ssoConfig.url + '?service=' + service;\n } else if (window.ssoConfig.mode == 'oauth') {\n if (!window.ssoConfig.clientId) {\n throw 'oauth模式下必须提供clientId';\n }\n\n var _service = window.location.href;\n localStorage.setItem('service', _service);\n window.location.href = \"\".concat(window.ssoConfig.url, \"?response_type=code&client_id=\").concat(window.ssoConfig.clientId, \"&redirect_uri=\").concat(_service);\n }\n};\n\nvar handelShortUrl = function handelShortUrl(to, from, next) {\n req.get('${portal}/portal/shorturlManage/v1/getLongUrlByShortUrl?shortUrl=' + to.fullPath.substr(1), '', false).then(function (resp) {\n if (resp && resp.data && resp.data.state) {\n store.dispatch('login/validAndCompletedCurrent', resp.data.value.guestToken).then(function () {\n next({\n path: resp.data.value.url\n });\n }).catch(function () {\n logoutAndCleanUp(to, from, next);\n });\n } else {\n next({\n path: '/messageFillPage/' + resp.data.message\n });\n }\n }).catch(function () {\n logoutAndCleanUp(to, from, next);\n });\n};\n\nvar logoutAndCleanUp = function logoutAndCleanUp(to, from, next) {\n store.dispatch('login/logoutAndCleanUp').then(function () {\n if (window.ssoConfig.mode && window.ssoConfig.mode != 'jwt' && !ticket) {\n ssoRedirect();\n } else if (!window.ssoConfig.mode || window.ssoConfig.mode == 'jwt') {\n next({\n path: '/login',\n query: {\n redirect: to.fullPath\n }\n });\n } else {\n throw '登录失败';\n }\n });\n}; // 移除url后面的指定参数\n\n\nvar removeUrlParams = function removeUrlParams(param) {\n var query = window.location.search.substring(1);\n\n if (!query) {\n return;\n }\n\n var vars = query.split('&');\n var newVars = [];\n\n for (var i = 0; i < vars.length; i++) {\n var pair = vars[i].split('=');\n\n if (pair[0] != param) {\n newVars.push(vars[i]);\n }\n }\n\n setTimeout(function () {\n var path = \"\".concat(window.location.pathname).concat(newVars.length > 0 ? '?' : '').concat(newVars.join('&'));\n window.history.replaceState(null, null, path);\n }, 1000);\n};\n\nvar loadingInstance;\n\nvar tokenLogin = function tokenLogin(userInfo, next) {\n store.dispatch('login/loginByPrincipal', userInfo).then(function (loginStatus) {\n if (loginStatus && loginStatus == true) {\n store.dispatch('menu/actionFrontMenus').then(function (res) {\n next({\n path: \"/frontPlat/\".concat(res[0].alias) // path: `/newOpen/cockpit`\n\n });\n removeUrlParams('tokenKey'); // loadingInstance.close()\n });\n }\n });\n};\n\nvar accountLogin = function accountLogin(account, next) {\n console.log(account);\n store.dispatch('login/loginByAccount', account).then(function (loginStatus) {\n console.log(loginStatus);\n\n if (loginStatus && loginStatus == true) {\n store.dispatch('menu/actionFrontMenus').then(function (res) {\n console.log(res);\n next({\n path: \"/comprehensiveTheme\" // path: `/business`\n\n }); // removeUrlParams('tokenKey')\n // loadingInstance.close()\n });\n }\n });\n};\n\nrouter.beforeEach(function (to, from, next) {\n // 用户中心登录到养护系统 携带tokenKey\n console.log(to.name == 'login' && to.query.userName);\n\n if (to.name == 'login' && to.query.userName) {\n // loadingInstance = Loading.service({ fullscreen: true ,background: 'rgba(0, 0, 0, 0.6)'});\n // let data = {\n // key: to.query.tokenKey\n // }\n // let token = {\n // token: ''\n // }\n var account = to.query.userName; ///to.query.account\n // tokenLogin({\n // account: \"admin\",\n // password: \"artfess\"\n // }, next);\n // uc.accountLogin(account).then(res => {\n // \tif (res.loginStatus) {\n\n accountLogin(account, next); // \t} else {\n // \t\tMessage.error(res.msg)\n // \t}\n // })\n // uc.authFormUserTokenKey(data).then(res => {\n // // debugger;\n // console.log(res)\n // if (res.success) {\n // token.token = res.data\n // uc.authUserInfo(token).then(res => {\n // console.log(res, 'resresresres')\n // if (res.success) {\n // //同步后获取用户名密码登录\n // accountLogin(\n // {\n // account: 'admin',\n // password: 'artfess'\n // },\n // next\n // )\n // } else {\n // Message.error(res.msg)\n // // loadingInstance.close()\n // }\n // })\n // } else {\n // Message.error(res.msg)\n // // loadingInstance.close()\n // }\n // })\n }\n\n store.dispatch('menu/getAllmenus', {}).then(function (menus) {\n //href菜单不进这段代码\n if (to.fullPath.indexOf('href') == -1) {\n var alias = to.fullPath.split('/')[1];\n\n for (var i = 0; i < menus.length; i++) {\n if (menus[i].alias === alias) {\n store.dispatch('menu/getCurrentMenu', {\n alias: menus[i].alias,\n name: menus[i].name\n });\n break;\n }\n }\n }\n });\n\n if (to.fullPath.startsWith('/surl/')) {\n handelShortUrl(to, from, next);\n return;\n } // 1.当前为单点登录模式,且要路由到login页面,则做单点登录重定向;\n\n\n if (to.name == 'login' && window.ssoConfig.mode && window.ssoConfig.mode != 'jwt') {\n // 单点登录时如果已经携带了code或者ticket时,如果是/login路径需要跳转到默认页面(解决反复跳转的问题)\n if ((window.ssoConfig.mode == 'cas' || window.ssoConfig.mode == 'oauth') && (to.query.code || to.query.ticket)) {\n window.location.href = window.location.href.replace('/login', '');\n return;\n } else {\n ssoRedirect();\n }\n }\n\n if (from.name != 'defStart' || to.name != 'instStart') {\n sessionStorage.removeItem('formImportTempRefId');\n sessionStorage.removeItem('formImportTempJson');\n }\n\n if (sessionStorage.menu_alias && to.fullPath && to.fullPath.split('/')[1] == 'home') {\n sessionStorage.menu_alias = '';\n }\n\n if (to.matched.some(function (record) {\n return !record.meta.anonymous;\n })) {\n var _ticket = to.query.token; // 2.当前已经从单点页面重定向回来了,且在url地址中携带了ticket或code;\n\n if (window.ssoConfig.mode == 'cas') {\n _ticket = to.query.ticket;\n } else if (window.ssoConfig.mode == 'oauth') {\n _ticket = to.query.code;\n }\n\n store // 3.携带ticket做用户鉴权;\n .dispatch('login/validAndCompletedCurrent', _ticket).then(function () {\n store._vm.$root.$emit('login-completed');\n\n if (registerRouteFresh) {\n if (sessionStorage.menu_alias) {\n var path = '/' + sessionStorage.menu_alias;\n var isChildren = router.addList(path, router.options.routes); //动态新增二级路由\n //当前点击菜单的路由别名不存在 router.js 里面\n // if (!isChildren) {\n // let alias_new = {\n // path: path,\n // name: 'alias_new',\n // component: resolve =>\n // require(['@/views/menuContent.vue'], resolve),\n // children: []\n // }\n // router.options.routes.push(alias_new)\n // router.addList(path, router.options.routes) //动态新增二级路由\n // }\n\n router.replace({\n path: to.path,\n query: to.query\n });\n }\n\n registerRouteFresh = false;\n }\n\n next(); // url地址带token的方式认证成功后删除url中的token\n\n removeUrlParams('token');\n }).catch(function () {\n // 4.鉴权失败时根据当前模式重定向到对应页面。\n logoutAndCleanUp(to, from, next);\n });\n } else {\n next();\n }\n});\nexport default router;",null]}