{"remainingRequest":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\Login.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\Login.vue","mtime":1706042431896},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.number.constructor\";\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//\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//\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//\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//\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport portal from '@/api/portal.js';\nimport Cookie from 'js-cookie';\nexport default {\n name: 'login',\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 var checkPhone = function checkPhone(rule, value, callback) {\n var regExp = /^1[3|4|5|7|8|9][0-9]{9}$/;\n\n if (!regExp.test(value)) {\n callback(new Error('请输入正确的手机号'));\n } else {\n callback();\n }\n };\n\n return {\n logoUrl: '',\n // logo图片地址\n name: 'EDP',\n companyName: '机电采购平台',\n principal: {\n account: '',\n password: '',\n remberPwd: 0\n },\n rules: {\n account: [{\n validator: checkAccount,\n trigger: 'blur'\n }],\n password: [{\n required: true,\n message: '请输入密码',\n trigger: 'blur'\n }],\n phone: [{\n validator: checkPhone,\n trigger: 'blur'\n }],\n code: [{\n required: true,\n message: '请输入验证码',\n trigger: 'blur'\n }]\n },\n responseError: '',\n loading: false,\n accountLogin: true,\n accountType: 'account',\n isSendMessage: false,\n timer: null,\n second: 60,\n show_qr: true,\n activeQR: 'qywx',\n qrList: [{\n name: '企业微信',\n key: 'qywx',\n url: require('@/assets/img/login/qywx-logo.png')\n }, {\n name: '微信',\n key: 'wx',\n url: require('@/assets/img/login/wx-logo.png')\n }, {\n name: '钉钉',\n key: 'dd',\n url: require('@/assets/img/login/dd-logo.png')\n }, {\n name: '支付宝',\n key: 'zfb',\n url: require('@/assets/img/login/zfb-logo.png')\n }]\n };\n },\n mounted: function mounted() {\n window.webSocket && window.webSocket.close();\n this.clearUser();\n this.setDefaultValue();\n this.sysSetting();\n },\n methods: {\n changeQR: function changeQR(key) {\n var _this = this;\n\n this.activeQR = key;\n this.show_qr = false;\n setTimeout(function () {\n _this.show_qr = true;\n }, 1000);\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 //如果记住密码则默认表单赋值\n setDefaultValue: function setDefaultValue() {\n var account = Cookie.get('account'),\n remberPwd = Cookie.get('remberPwd'),\n password = Cookie.get('accountPwd');\n\n if (remberPwd) {\n // remberPwd Number(remberPwd)\n // 如果有记住密码 取密文解密放进输入框\n var Base64 = require('js-base64').Base64;\n\n password = Base64.decode(password);\n this.principal = {\n account: account,\n password: password,\n remberPwd: Number(remberPwd)\n };\n }\n },\n loginTypeChange: function loginTypeChange(type) {\n this.accountLogin = type;\n this.accountLogin ? null : this.getQr();\n },\n getQr: function getQr() {\n var page = '/fvue/auth';\n var host = window.location.protocol + '//' + window.location.hostname;\n var port = window.location.port;\n var url = host + ':' + port + page;\n this.wwLogin = new WwLogin({\n id: 'qr_login',\n appid: window.context.corp_id,\n agentid: window.context.agent_id,\n redirect_uri: encodeURI(url),\n state: 'hellowecom',\n href: 'data:text/css;base64,LmltcG93ZXJCb3ggLnRpdGxlIHtjb2xvcjogI2ZmZjt9Ci5pbXBvd2VyQm94IC5zdGF0dXMge2NvbG9yOiAjZmZmO30=',\n // data:text/css;base64,\n lang: 'zh'\n });\n },\n changeAccountType: function changeAccountType(type) {\n this.accountType = type;\n this.$refs.principal.clearValidate();\n },\n sendMessage: function sendMessage() {\n if (!this.isSendMessage) {\n this.validateField();\n }\n },\n validateField: function validateField() {\n var _this2 = this;\n\n this.$refs.principal.validateField('phone', function (err) {\n if (!err) {\n _this2.isSendMessage = true;\n\n _this2.countdown();\n }\n });\n },\n countdown: function countdown() {\n var _this3 = this;\n\n this.timer = setInterval(function () {\n _this3.second--;\n\n if (_this3.second == 0) {\n clearInterval(_this3.timer);\n _this3.isSendMessage = false;\n _this3.second = 60;\n }\n }, 1000);\n },\n //获取系统默认配置 系统Logo、名称\n sysSetting: function sysSetting() {\n var _this4 = this;\n\n var url = '${uc}/uc/tenantManage/v1/getTenantByCode?code=platform';\n this.$http.get(url).then(function (resp) {\n if (resp.data) {\n var tenantManage = resp.data; // this.companyName = tenantManage.nameFront\n\n if (tenantManage.frontLogo) {\n var frontLogo = JSON.parse(tenantManage.frontLogo);\n\n if (frontLogo && frontLogo.length > 0) {\n _this4.$http.get(window.context.portal + '/file/onlinePreviewController/v1/getFileById_' + frontLogo[0].id, 'arraybuffer').then(function (response) {\n var type = response.headers['content-type'];\n\n if (type) {\n _this4.logoUrl = window.URL.createObjectURL(new Blob([response.data], {\n type: type\n }));\n } else {\n _this4.logoUrl = window.URL.createObjectURL(new Blob([response.data]));\n }\n });\n }\n }\n }\n });\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 _this5 = this;\n\n this.$refs[formName].validate(function (valid) {\n if (valid) {\n _this5.inputGetFocus();\n\n _this5.setRouterPath();\n\n _this5.loading = true;\n\n _this5.$store.dispatch('login/loginByPrincipal', _this5.principal).then(function (loginStatus) {\n if (loginStatus && loginStatus == true) {\n _this5.$store.dispatch('menu/getCurrentUserMethodAuth');\n\n _this5.getAllDict();\n\n _this5.$store.dispatch('menu/actionFrontMenus').then(function (res) {\n if (!res || !res.length) {\n _this5.clearUser();\n\n _this5.loading = false;\n\n _this5.$message.warning('抱歉!您尚无可访问页面,请联系管理员添加!');\n\n return;\n } else {\n _this5.$router.push({\n path: \"/platLayout/toDoTask\"\n });\n }\n\n return;\n var bigScreen = res && res.filter(function (item) {\n return item.alias === 'bigScreen';\n }); // 如果用户有大屏菜单进去大屏页面\n\n if (bigScreen && bigScreen.length !== 0) {\n _this5.$router.push({\n path: \"/\".concat(bigScreen[0].children[0].alias)\n });\n\n return;\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 _this5.$router.push({\n path: \"/platLayout/\".concat(dataMenus[0].children[0].children[0].alias)\n });\n } else {\n _this5.$router.push({\n path: \"/platLayout/\".concat(dataMenus[0].children[0].alias)\n });\n }\n }\n });\n } else if (loginStatus == false) {\n _this5.$router.push({\n name: 'resetPwdView',\n query: {\n type: 'login'\n }\n });\n }\n }).catch(function (msg) {\n _this5.loading = false;\n console.log(msg, 'msg');\n\n if (msg.indexOf && msg.indexOf('timeout of') !== -1) {\n msg = '登录超时';\n }\n\n _this5.responseError = msg;\n });\n } else {\n return false;\n }\n });\n },\n getAllDict: function getAllDict() {\n portal.getSysDict().then(function (data) {\n // console.log(data, '字典')\n if (data) {\n sessionStorage.setItem('dict_data', JSON.stringify(data));\n }\n }).catch(function (err) {// console.log(err, '字典err')\n });\n },\n inputGetFocus: function inputGetFocus() {\n this.responseError = '';\n },\n resetForm: function resetForm(formName) {\n this.responseError = '';\n this.$refs[formName].resetFields();\n }\n }\n};",null]}