{"remainingRequest":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\ljzc-fvue\\src\\views\\Login\\components\\AccountLogin.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\src\\views\\Login\\components\\AccountLogin.vue","mtime":1701739792424},{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/ljzc-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport \"core-js/modules/es6.array.find\";\nimport \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport Cookie from 'js-cookie';\nimport portal from '@/api/portal.js';\nexport default {\n name: 'AccountLogin',\n props: ['tenant', 'systemInformation'],\n computed: {\n language: function language() {\n return localStorage.getItem('lang') || 'zh-CN';\n }\n },\n data: function data() {\n var checkAccount = function checkAccount(rule, value, callback) {\n if (!value) {\n return callback(new Error('请输入账号'));\n }\n\n if (/^[a-zA-Z0-9_-]{2,20}$/.test(value)) {\n return callback();\n } else {\n return callback(new Error('账号格式不符合规范'));\n }\n };\n\n return {\n fullscreenLoading: true,\n hasMask: true,\n codeUrl: \"\".concat(window.location.origin, \"/mobilevue\"),\n frontBase: \"\".concat(window.location.origin),\n logo: '',\n name: 'EDP',\n showTenant: false,\n showLogo: false,\n companyName: '',\n tenantName: '',\n principal: {\n account: '',\n password: ''\n },\n rules: {\n account: [{\n validator: checkAccount,\n trigger: 'blur'\n }],\n password: [{\n required: true,\n message: '请输入密码',\n trigger: 'blur'\n }]\n },\n responseError: '',\n loading: false,\n totemStyle: {// backgroundColor: '#fff',\n // background: `url(${require('@/assets/img/loginImg.jpg')}) no-repeat center / 100% 100%`\n // background: `#1975FF url(${require(\"@/assets/img/totem.png\")}) center / 100% auto no-repeat`\n // background: `transparent url(${require(\"@/assets/img/totem1.png\")}) no-repeat center 30% / 100% 70% `\n },\n //负责的是登录页授权文件相关数据变量\n isIeExplorer: false,\n dialogVisible: false,\n downLoading: false,\n accept: '.lic',\n files: [],\n uploadingFiles: {}\n };\n },\n mounted: function mounted() {\n this.clearUser();\n\n if (!this.$route.query || !this.$route.query.tokenKey) {\n this.hasMask = false;\n this.fullscreenLoading = false;\n }\n\n window.webSocket && window.webSocket.close(); // this.setDefaultValue()\n //获取租户信息\n\n var tenant = this.tenant ? this.tenant : 'platform';\n\n if (tenant) {\n var url = '${uc}/uc/tenantManage/v1/getTenantByCode?code=' + tenant;\n\n var _this = this;\n\n this.$http.get(url).then(function (resp) {\n if (resp.data) {\n var tenantManage = resp.data;\n _this.showTenant = true;\n _this.companyName = tenantManage.nameFront;\n\n if (tenant != 'platform') {\n _this.principal.tenantId = resp.data.id;\n }\n\n if (tenantManage.ico) {\n var ico = JSON.parse(tenantManage.ico);\n\n if (ico && ico.length > 0) {\n _this.showLogo = true;\n _this.logo = window.context.portal + '/system/file/v1/getLogoFile?logoType=front&tenantId=' + tenantManage.id;\n }\n }\n }\n });\n } else {\n //不是租户\n this.sysSetting();\n }\n },\n methods: {\n //获取系统默认配置 系统Logo、名称\n sysSetting: function sysSetting() {\n var _this = this;\n\n var url = window.context.portal + '/sys/sysProperties/v1/getDecryptBySysSetting';\n this.$http.get(url).then(function (response) {\n if (response && response.data && response.data.value) {\n _this.showTenant = true;\n var sysSettingData = JSON.parse(response.data.value);\n\n if (sysSettingData.frontName == '') {\n _this.companyName = _this.name;\n } else {\n _this.companyName = sysSettingData.frontName;\n }\n\n if (sysSettingData.ico.length > 0) {\n var ico = sysSettingData.ico;\n _this.showLogo = true;\n _this.logo = window.context.portal + '/system/file/v1/downloadFile?fileId=' + ico[0].id;\n }\n }\n });\n },\n querySearch: function querySearch(queryString, cb) {\n if (!queryString) {\n cb([]);\n return;\n }\n\n var queryFilter = {};\n queryFilter.pageBean = {\n page: 1,\n pageSize: 20,\n total: 0,\n showTotal: true\n };\n var query = {\n property: 'name_',\n value: queryString,\n group: 'main',\n operation: 'LIKE',\n relation: 'AND'\n };\n\n if (!queryFilter.querys) {\n queryFilter.querys = [];\n }\n\n queryFilter.querys.push(query);\n this.$http.post(\"\".concat(window.context.uc, \"/uc/tenantManage/v1/listJson\"), queryFilter).then(function (res) {\n // 调用 callback 返回建议列表的数据\n cb(res.data.rows);\n });\n },\n handleSelect: function handleSelect(item) {\n this.tenantName = item.name;\n this.principal.tenantId = item.id;\n },\n setRouterPath: function setRouterPath() {\n this.$store.dispatch('login/actionLoginAccount', this.principal.account);\n localStorage.setItem(this.principal.account + 'loginRoutePath', this.$route.path);\n },\n submitForm: function submitForm(formName) {\n var _this2 = this;\n\n this.$refs[formName].validate(function (valid) {\n if (valid) {\n _this2.inputGetFocus();\n\n _this2.setRouterPath();\n\n _this2.loading = true;\n console.warn(_this2.principal, 'login');\n\n _this2.$store.dispatch('login/loginByPrincipal', _this2.principal).then(function (loginStatus) {\n if (loginStatus && loginStatus == true) {\n console.warn(loginStatus, _this2.$route.query);\n\n _this2.getAllDict();\n\n _this2.$router.push({\n path: _this2.$route.query.redirect ? _this2.$route.query.redirect : '/'\n }); // 首先获取用户详细信息 角色列表 便于查询角色菜单\n\n\n _this2.$store.dispatch('user/loadCurrentUserDetail').then(function () {\n //获取前台页面所有菜单\n _this2.$store.dispatch('menu/actionFrontMenus').then(function (res) {\n if (!res || !res.length) {\n _this2.clearUser();\n\n _this2.$message.warning('抱歉!您尚无可访问页面,请联系管理员添加!');\n } else {\n // 此段逻辑为调整中屏页面\n\n /*let dataArr = res && res.filter(item => item.alias === 'bigScreen')\r\n console.warn(res, dataArr, `/${dataArr[0].children[0].alias}`)\r\n // 如果用户有大屏菜单进去大屏页面\r\n if (dataArr && dataArr.length !== 0) {\r\n if (dataArr[0].children.length !== 0) {\r\n this.$router.push({\r\n path: `/${dataArr[0].children[0].alias}`\r\n })\r\n }\r\n } else {\r\n // 如果用户没有大屏菜单 则根据第一角色查菜单\r\n this.getRoleMenus()\r\n }*/\n // 此段逻辑为调整工作台页面\n // 递归查询菜单树形结构中children第一项的最底层的调整路径\n var _ref = res && res.find(function (i) {\n return i.alias === 'normal';\n }),\n children = _ref.children;\n\n var getPath = function getPath(treeData) {\n var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n if (Array.isArray(treeData[0].children) && treeData[0].children.length) {\n path += \"/\".concat(treeData[0].alias);\n return getPath(treeData[0].children, path);\n } else {\n return path + \"/\".concat(treeData[0].alias);\n }\n };\n\n _this2.$router.push(getPath(children, '/platLayout'));\n }\n\n _this2.loading = false;\n });\n }); // 连接websocket\n\n\n _this2.$bus.$emit('login');\n } else if (loginStatus == false) {\n _this2.$router.push({\n name: 'resetPwdView',\n query: {\n type: 'login'\n }\n });\n }\n }).catch(function (msg) {\n _this2.loading = false;\n console.log(msg, 'msg');\n\n if (msg.indexOf && msg.indexOf('timeout of') !== -1) {\n msg = '登录超时';\n }\n\n _this2.responseError = msg;\n });\n } else {\n return false;\n }\n });\n },\n loadRoleMenus: function loadRoleMenus(RoleCode) {\n var _this3 = this;\n\n return new Promise(function (resovle, reject) {\n _this3.$store.dispatch('menu/actionsRoleMenu', RoleCode).then(function (res) {\n if (res.length) {\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 _this3.$router.push({\n path: \"/platLayout/\".concat(dataMenus[0].children[0].children[0].alias)\n });\n } else {\n _this3.$router.push({\n path: \"/platLayout/\".concat(dataMenus[0].children[0].alias)\n });\n }\n }\n\n resovle('enter');\n } else {\n resovle('nextRole');\n }\n });\n });\n },\n clearUser: function clearUser() {\n this.$store.dispatch('menu/clearMenus');\n this.$store.dispatch('user/clearUser');\n this.$store.dispatch('menu/setCopyMenus', []);\n this.$store.dispatch('login/logoutAndCleanUp');\n },\n getRoleMenus: function () {\n var _getRoleMenus = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var UserDetail, roleList, i, res, defaultRoleCode;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n UserDetail = JSON.parse(sessionStorage.getItem('currentUserDetail'));\n roleList = UserDetail.roleList;\n console.log(roleList, 'roleList'); // 多角色 找到第一个有菜单的角色\n\n i = 0;\n\n case 4:\n if (!(i < roleList.length)) {\n _context.next = 17;\n break;\n }\n\n console.log(roleList[i], 'resovle');\n _context.next = 8;\n return this.loadRoleMenus(roleList[i].roleCode);\n\n case 8:\n res = _context.sent;\n console.log(res);\n\n if (!(res == 'enter')) {\n _context.next = 14;\n break;\n }\n\n // 设置当前角色\n defaultRoleCode = roleList[i].roleCode;\n sessionStorage.setItem('currentRoleCode', defaultRoleCode);\n return _context.abrupt(\"break\", 17);\n\n case 14:\n i++;\n _context.next = 4;\n break;\n\n case 17:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function getRoleMenus() {\n return _getRoleMenus.apply(this, arguments);\n }\n\n return getRoleMenus;\n }(),\n getAllDict: function getAllDict() {\n portal.getSysDict().then(function (data) {\n console.log(data, '字典');\n\n if (data) {\n sessionStorage.setItem('dict_data', JSON.stringify(data));\n }\n }).catch(function (err) {\n console.log(err, '字典err');\n });\n },\n inputGetFocus: function inputGetFocus() {\n this.responseError = '';\n }\n },\n created: function created() {\n var USER_AGENT = navigator.userAgent.toLowerCase();\n var isChrome = /.*(chrome)\\/([\\w.]+).*/;\n\n if (!isChrome.test(USER_AGENT)) {\n this.isIeExplorer = true;\n }\n }\n};",null]}