| | |
| | | <img src="@/assets/images/bg@2x.png" class="main_bg" alt=""> |
| | | <div class="login_wrap"> |
| | | <div class="login_img"> |
| | | <div class="h3" style="font-size: 30px; margin-left: 140px; margin-bottom: 0;">芜湖烟草</div> |
| | | <div class="h3">智慧物流园区安消一体化系统</div> |
| | | <div class="h3" style="font-size: 30px; margin-bottom: 0;">{{sysConfig.title || ''}}</div> |
| | | <div class="h3">{{sysConfig.subtitle || title}}</div> |
| | | </div> |
| | | <div class="form_wrap"> |
| | | <div class="tabs"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapMutations } from 'vuex' |
| | | import { getCaptcha, loginByPassword, sendSmsPost, loginByPhone } from '@/api/system/common' |
| | | import Cookies from "js-cookie" |
| | | import { mapMutations, mapState } from 'vuex' |
| | | import { getCaptcha, loginByPassword, sendSmsPost, loginByPhone, getSystemConfig } from '@/api/system/common' |
| | | import Cookies from 'js-cookie' |
| | | import { Message } from 'element-ui' |
| | | |
| | | export default { |
| | | name: 'Login', |
| | | data() { |
| | | data () { |
| | | return { |
| | | title: process.env.VUE_APP_TITLE, |
| | | loading: false, |
| | | isRemPsd: false, |
| | | username: '', |
| | | password: '', |
| | | phone: '', |
| | | downTime: 0, |
| | | |
| | | smsCode: '', |
| | | activeTab: '0', |
| | | // 验证码 |
| | |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | computed: { |
| | | ...mapState(['sysConfig']) |
| | | }, |
| | | mounted () { |
| | | this.username = localStorage.getItem('username') || '' |
| | | this.password = localStorage.getItem('password') || '' |
| | | this.phone = localStorage.getItem('phone') || '' |
| | | const isRemPsd = localStorage.getItem('isRemPsd') || false |
| | | this.isRemPsd = JSON.parse(isRemPsd) |
| | | this.refreshCaptcha() |
| | | this.getSystemConfig() |
| | | }, |
| | | methods: { |
| | | ...mapMutations(['setUserInfo']), |
| | | ...mapMutations(['setUserInfo', 'setSysconfig']), |
| | | getSystemConfig () { |
| | | getSystemConfig() |
| | | .then((res) => { |
| | | if (res && res.subtitle) { |
| | | this.setSysconfig(res) |
| | | } |
| | | }) |
| | | }, |
| | | // 登录 |
| | | login() { |
| | | login () { |
| | | if (this.loading) { |
| | | return |
| | | } |
| | |
| | | this.loading = false |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | getCode() { |
| | | getCode () { |
| | | console.log('getCode') |
| | | const { phone } = this |
| | | if (!phone || phone.length != 11) { |
| | |
| | | sendSmsPost({ phone, type: 0 }).then(res => { |
| | | Message.success('短信发送成功') |
| | | this.downTime = 60 |
| | | let timer = setInterval(() => { |
| | | const timer = setInterval(() => { |
| | | if (this.downTime == 0) { |
| | | return clearInterval(timer) |
| | | } |
| | |
| | | }, 1000) |
| | | }) |
| | | }, |
| | | tabClick(val) { |
| | | tabClick (val) { |
| | | this.activeTab = val |
| | | }, |
| | | // 刷新验证码 |
| | | refreshCaptcha() { |
| | | refreshCaptcha () { |
| | | this.captcha.loading = true |
| | | getCaptcha() |
| | | .then(data => { |
| | |
| | | }) |
| | | }, |
| | | // 登录前验证 |
| | | __check() { |
| | | __check () { |
| | | if (this.username.trim() === '') { |
| | | this.$tip.error('请输入用户名') |
| | | return false |
| | |
| | | } |
| | | return true |
| | | } |
| | | }, |
| | | } |
| | | |
| | | } |
| | | </script> |
| | |
| | | height: 600px; |
| | | background: url("../assets/images/login_img@2x.png"); |
| | | background-size: 100% 100%; |
| | | padding-left: 40px; |
| | | padding-top: 60px; |
| | | |
| | | .h2 { |
| | |
| | | align-items: center; |
| | | justify-content: center; |
| | | border-radius: 4px; |
| | | text-align: center; |
| | | width: 208px; |
| | | display: flex; |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .h3 { |
| | | text-align: center; |
| | | font-size: 28px; |
| | | font-weight: 700; |
| | | color: #fff; |