| | |
| | | <template> |
| | | <div class="main"> |
| | | <div style="display: flex;padding: 50px;"> |
| | | |
| | | <div style="flex: 1;display: flex;align-items: center;justify-content: center;position: relative"> |
| | | <div class="top"> |
| | | <div class="header"> |
| | | <a href="/"> |
| | | <img src="~@/assets/lxzn.png" class="logo" alt="logo"> |
| | | <span class="title">MDC智慧车间</span> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | <img src="@/assets/login.jpeg" width="60%"> |
| | | </div> |
| | | <div style="width: 368px;margin: 30px 50px"> |
| | | <a-form-model |
| | | class="user-layout-login" |
| | | @keyup.enter.native="handleSubmit" |
| | |
| | | </a-form-model-item> |
| | | |
| | | </a-form-model> |
| | | |
| | | </div> |
| | | </div> |
| | | <!--<two-step-captcha v-if="requiredTwoStepCaptcha" :visible="stepCaptchaVisible" @success="stepCaptchaSuccess" @cancel="stepCaptchaCancel"></two-step-captcha>--> |
| | | <login-select-tenant |
| | | ref="loginSelect" |
| | |
| | | requiredTwoStepCaptcha: false, |
| | | stepCaptchaVisible: false, |
| | | encryptedString: { |
| | | key: "", |
| | | iv: "", |
| | | key: '', |
| | | iv: '' |
| | | }, |
| | | url: { |
| | | getPrimaryInfo: "/sys/sysAnnouncementSend/getPrimaryInfo" |
| | | getPrimaryInfo: '/sys/sysAnnouncementSend/getPrimaryInfo' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | Vue.ls.remove(ACCESS_TOKEN) |
| | | this.getRouterData(); |
| | | this.getRouterData() |
| | | this.rememberMe = true |
| | | }, |
| | | methods: { |
| | |
| | | |
| | | //登录 |
| | | handleSubmit() { |
| | | this.loginBtn = true; |
| | | this.loginBtn = true |
| | | if (this.customActiveKey === 'tab1') { |
| | | // 使用账户密码登录 |
| | | this.$refs.alogin.handleLogin(this.rememberMe) |
| | |
| | | }, |
| | | // 校验失败 |
| | | validateFail() { |
| | | this.loginBtn = false; |
| | | this.loginBtn = false |
| | | }, |
| | | // 登录后台成功 |
| | | requestSuccess(loginResult) { |
| | | // this.$router.push({ path: "/isps/userAnnouncement" }).catch(() => { |
| | | // console.log('登录跳转首页出错,这个错误从哪里来的') |
| | | // }) |
| | | this.$router.push({ path: "/dashboard/analysis" }).catch(() => { |
| | | this.$router.push({ path: '/dashboard/analysis' }).catch(() => { |
| | | console.log('登录跳转首页出错,这个错误从哪里来的') |
| | | }) |
| | | this.$notification.success({ |
| | | message: '欢迎', |
| | | description: `${timeFix()},欢迎回来`, |
| | | }); |
| | | var userId = store.getters.userInfo.id; |
| | | let that = this; |
| | | description: `${timeFix()},欢迎回来` |
| | | }) |
| | | var userId = store.getters.userInfo.id |
| | | let that = this |
| | | getAction(this.url.getPrimaryInfo, { userId: userId }).then(res => { |
| | | if (res.success) { |
| | | for (var i = 0; i < res.result.length; i++) { |
| | |
| | | message: '最新未读消息【' + res.result[i].msgCategory + '】', |
| | | description: res.result[i].msgContent, |
| | | duration: 60, |
| | | icon: <a-icon type="exclamation-circle" style="color:red" />, |
| | | }); |
| | | icon: <a-icon type = 'exclamation-circle'style = 'color:red' / >, |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }) |
| | |
| | | }, |
| | | //登录后台失败 |
| | | requestFailed(err,username) { |
| | | let description = ((err.response || {}).data || {}).message || err.message || "请求出现错误,请稍后再试" |
| | | let description = ((err.response || {}).data || {}).message || err.message || '请求出现错误,请稍后再试' |
| | | if(err.code!==5001&&err.code!==5002){ |
| | | this.$notification['error']({ |
| | | message: '登录失败', |
| | | description: description, |
| | | duration: 4, |
| | | }); |
| | | duration: 4 |
| | | }) |
| | | }else{ |
| | | this.$notification['warning']({ |
| | | message: '提示', |
| | |
| | | console.log('err',err) |
| | | this.$refs.userPassword.show(username) |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | //账户密码登录错误后更新验证码 |
| | | // if (this.customActiveKey === 'tab1' && description.indexOf('密码错误') > 0) { |
| | | // this.$refs.alogin.handleChangeCheckCode() |
| | | // } |
| | | this.loginBtn = false; |
| | | this.loginBtn = false |
| | | }, |
| | | loginSelectOk() { |
| | | this.loginSuccess() |
| | | }, |
| | | //登录成功 |
| | | loginSuccess() { |
| | | this.$router.push({ path: "/isps/userAnnouncement" }).catch(() => { |
| | | this.$router.push({ path: '/isps/userAnnouncement' }).catch(() => { |
| | | console.log('登录跳转首页出错,这个错误从哪里来的') |
| | | }) |
| | | this.$notification.success({ |
| | | message: '欢迎', |
| | | description: `${timeFix()},欢迎回来`, |
| | | }); |
| | | description: `${timeFix()},欢迎回来` |
| | | }) |
| | | |
| | | }, |
| | | |
| | |
| | | }, |
| | | //获取密码加密规则 |
| | | getEncrypte() { |
| | | var encryptedString = Vue.ls.get(ENCRYPTED_STRING); |
| | | var encryptedString = Vue.ls.get(ENCRYPTED_STRING) |
| | | if (encryptedString == null) { |
| | | getEncryptedString().then((data) => { |
| | | this.encryptedString = data |
| | | }); |
| | | }) |
| | | } else { |
| | | this.encryptedString = encryptedString; |
| | | this.encryptedString = encryptedString |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /deep/ .ant-tabs-tab-active.ant-tabs-tab { |
| | | font-size: 25px; |
| | | } |
| | | |
| | | .top { |
| | | text-align: center; |
| | | position: absolute; |
| | | top: 45px; |
| | | |
| | | .header { |
| | | height: 44px; |
| | | line-height: 44px; |
| | | |
| | | .badge { |
| | | position: absolute; |
| | | display: inline-block; |
| | | line-height: 1; |
| | | vertical-align: middle; |
| | | margin-left: -12px; |
| | | margin-top: -10px; |
| | | opacity: 0.8; |
| | | } |
| | | |
| | | .logo { |
| | | height: 44px; |
| | | vertical-align: top; |
| | | margin-right: 10px; |
| | | border-style: none; |
| | | } |
| | | |
| | | .title { |
| | | font-size: 30px; |
| | | color: #000; |
| | | font-family: "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; |
| | | font-weight: 600; |
| | | position: relative; |
| | | top: 2px; |
| | | } |
| | | } |
| | | .desc { |
| | | font-size: 14px; |
| | | color: rgba(0, 0, 0, 0.45); |
| | | margin-top: 12px; |
| | | margin-bottom: 40px; |
| | | } |
| | | } |
| | | |
| | | </style> |
| | | <style> |
| | | .valid-error .ant-select-selection__placeholder { |