{"remainingRequest":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\eslint-loader\\index.js??ref--13-0!D:\\jenkins\\workspace\\damDance-fvue\\src\\router.js","dependencies":[{"path":"D:\\jenkins\\workspace\\damDance-fvue\\src\\router.js","mtime":1698044803532},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\damDance-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/damDance-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/damDance-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 NoAuth from '@/views/NoAuth.vue';\nimport req from '@/request.js';\nimport qs from 'qs';\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: '/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: '/bigScreen',\n name: 'bigScreen',\n component: function component() {\n return import('@/views/BigScreen/bigScreen.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' // 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\nrouter.beforeEach( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(to, from, next) {\n var _ticket;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // console.log(to.name, from.name, 'to,from')\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 _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 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 // 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]}