{"remainingRequest":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\eslint-loader\\index.js??ref--13-0!D:\\jenkins\\workspace\\sfz-lh-fvue\\src\\router.js","dependencies":[{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\src\\router.js","mtime":1708421549136},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\sfz-lh-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 \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/sfz-lh-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.regexp.search\";\nimport _toConsumableArray from \"D:/jenkins/workspace/sfz-lh-fvue/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\n\nvar _this = this;\n\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 NoAuth from '@/views/NoAuth.vue';\nimport req from '@/request.js';\nimport qs from 'qs';\nimport uc from '@/api/uc.js';\nimport portal from '@/api/portal.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'; // import { component } from 'vue/types/umd'\n\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: '/auth',\n name: 'auth',\n component: function component() {\n return import('@/views/Auth.vue');\n },\n meta: {\n single: true,\n anonymous: true\n }\n }, {\n path: '/testPlayer',\n name: 'testPlayer',\n component: function component() {\n return import('@/views/testPlayer.vue');\n },\n meta: {\n single: true,\n anonymous: true\n }\n }, {\n path: '/NoAuth',\n name: 'NoAuth',\n component: NoAuth,\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 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 path: '/balanceOverview',\n name: 'balanceOverview',\n component: function component() {\n return import('@/views/BigScreen/balanceOverview.vue');\n },\n meta: {\n keepAlive: true\n }\n }, {\n path: '/operationFees',\n name: 'operationFees',\n component: function component() {\n return import('@/views/BigScreen/operationFees.vue');\n },\n meta: {\n keepAlive: true\n }\n }, {\n path: '/deviceMonitor',\n name: 'deviceMonitor',\n component: function component() {\n return import('@/views/BigScreen/deviceMonitor.vue');\n },\n meta: {\n keepAlive: true\n }\n }, {\n path: '/itResources',\n name: 'itResources',\n component: function component() {\n return import('@/views/BigScreen/itResources.vue');\n },\n meta: {\n keepAlive: true\n }\n }, {\n path: '/homePage',\n name: 'homePage',\n component: function component() {\n return import('@/views/BigScreen/homePage.vue');\n },\n meta: {\n keepAlive: true // iframe: false // iframe页面缓存使用true\n\n }\n }, {\n path: '/trafficReportAI',\n name: 'trafficReportAI',\n component: function component() {\n return import('@/views/BigScreen/trafficReportAI.vue');\n },\n meta: {\n keepAlive: true\n }\n }, {\n path: '/vehicleReportAI',\n name: 'vehicleReportAI',\n component: function component() {\n return import('@/views/BigScreen/vehicleReportAI.vue');\n },\n meta: {\n keepAlive: true\n }\n }, {\n path: '/chargeDataReportAI',\n name: 'chargeDataReportAI',\n component: function component() {\n return import('@/views/BigScreen/chargeDataReportAI.vue');\n },\n meta: {\n keepAlive: true\n }\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' // query: {\n // redirect: to.fullPath\n // }\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 console.log(newVars);\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 tokenLoginBigScreen = function tokenLoginBigScreen(userInfo, next) {\n store.dispatch('login/loginByPrincipal', userInfo).then(function (loginStatus) {\n if (loginStatus && loginStatus == true) {\n portal.getSysDict().then(function (data) {\n if (data) {\n sessionStorage.setItem('dict_data', JSON.stringify(data));\n }\n });\n store.dispatch('menu/getCurrentUserMethodAuth');\n store.dispatch('menu/actionFrontMenus').then(function (res) {\n if (!res || !res.length) {\n _this.$message.warning('抱歉!您尚无可访问页面,请联系管理员添加!');\n\n next({\n path: \"/login\"\n });\n }\n\n var bigScreen = res && res.filter(function (item) {\n return item.alias === 'bigScreen';\n }); // 如果用户有大屏菜单进去大屏页面\n\n if (bigScreen && bigScreen.length !== 0) {\n next({\n path: \"/\".concat(bigScreen[0].children[0].alias)\n });\n }\n\n var dataMenus = res && res.filter(function (item) {\n return item.alias === 'normal';\n });\n\n if (dataMenus && dataMenus.length !== 0) {\n if (dataMenus[0].children.length !== 0 && dataMenus[0].children[0].children.length) {\n next({\n path: \"/platLayout/\".concat(dataMenus[0].children[0].children[0].alias)\n });\n } else {\n next({\n path: \"/platLayout/\".concat(dataMenus[0].children[0].alias)\n });\n }\n }\n });\n }\n });\n};\n\nrouter.beforeEach( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(to, from, next) {\n var data, _ticket;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (to.name == 'login' && to.query.tokenKey) {\n data = {\n key: to.query.tokenKey\n };\n uc.authFormUserTokenKey(data).then(function (res) {\n console.log(res);\n\n if (res.success) {\n tokenLoginBigScreen({\n account: \"tjadmin\",\n password: 'Bb123456789,.'\n }, next);\n } else {\n Message.error(res.msg);\n next({\n path: '/login'\n });\n }\n }).catch(function (err) {\n next({\n path: '/login'\n });\n });\n }\n\n if (!to.fullPath.startsWith('/surl/')) {\n _context.next = 4;\n break;\n }\n\n handelShortUrl(to, from, next);\n return _context.abrupt(\"return\");\n\n case 4:\n if (!(to.name == 'login' && window.ssoConfig.mode && window.ssoConfig.mode != 'jwt')) {\n _context.next = 11;\n break;\n }\n\n if (!((window.ssoConfig.mode == 'cas' || window.ssoConfig.mode == 'oauth') && (to.query.code || to.query.ticket))) {\n _context.next = 10;\n break;\n }\n\n window.location.href = window.location.href.replace('/login', '');\n return _context.abrupt(\"return\");\n\n case 10:\n ssoRedirect();\n\n case 11:\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 _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 portal.getSysDict().then(function (data) {\n if (data) {\n sessionStorage.setItem('dict_data', JSON.stringify(data));\n }\n });\n store.dispatch('menu/getCurrentUserMethodAuth');\n\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\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('tokenKey');\n }).catch(function () {\n // 4.鉴权失败时根据当前模式重定向到对应页面。\n logoutAndCleanUp(to, from, next);\n });\n } else {\n next();\n }\n\n case 14:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n}());\nexport default router;",null]}