|
|
@@ -7,25 +7,16 @@
|
|
|
</div>
|
|
|
<div class="login-right box-sizing-border flex-direction animate__animated animate__fadeInDown">
|
|
|
|
|
|
- <div class="fs-30 fw-500 fc-0A1629 mb-40 text-align-center">管理系统</div>
|
|
|
- <div class="tag-box">
|
|
|
- <tagList :tag-list="tabData" box-background="#fff" @tabSwitch="tabSwitch" />
|
|
|
- </div>
|
|
|
- <div class="login-input" :class="styleType === 1?'animate__animated animate__headShake':''">
|
|
|
+ <div class="fs-30 fw-500 fc-0A1629 mb-40 text-align-center">E签宝管理系统</div>
|
|
|
+ <div class="login-input">
|
|
|
<div class="fc-7D8592 mb-8 ml-8 fs-14">账号</div>
|
|
|
- <el-input v-model="loginForm.phone" placeholder="请输入手机号" />
|
|
|
+ <el-input v-model="loginForm.account" placeholder="请输入账号" />
|
|
|
</div>
|
|
|
- <div v-show="loginForm.tabType === 0" class="login-input"
|
|
|
- :class="styleType === 2?'animate__animated animate__headShake':'animate__animated animate__flipInX'">
|
|
|
+ <div class="login-input animate__animated animate__headShake">
|
|
|
<div class="fc-7D8592 mb-8 ml-8 fs-14">密码</div>
|
|
|
<el-input v-model="loginForm.password" placeholder="请输入密码" show-password />
|
|
|
</div>
|
|
|
- <div v-show="loginForm.tabType === 1" class="login-input"
|
|
|
- :class="styleType === 3?'animate__animated animate__headShake':'animate__animated animate__flipInX'">
|
|
|
- <div class="fc-7D8592 mb-8 ml-8 fs-14">验证码</div>
|
|
|
- <el-input v-model="loginForm.code" type="number" placeholder="请输入验证码" />
|
|
|
- <div class="fs-14 fc-3F8CFF get-code-c cursor" @click="getCode">{{ codeText }}</div>
|
|
|
- </div>
|
|
|
+
|
|
|
<div class="remember login-input flex-justify-space pt-10">
|
|
|
<div class="align-items-center">
|
|
|
<input v-model="hobby" class="mr-14" type="checkbox" value="true">
|
|
|
@@ -33,52 +24,35 @@
|
|
|
<div class="fc-7D8592 fs-16">记住我</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="login-but baC-2B7DFA fc-fff fs-16 text-align-center sys-radius-15 cursor" @click="toLogin">立即登录
|
|
|
- </div>
|
|
|
+ <div class="login-but baC-2B7DFA fc-fff fs-16 text-align-center sys-radius-15 cursor" @click="toLogin">立即登录</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import getCheckCode from './module/getCheckCode.vue'
|
|
|
- import tagList from '@/components/tagList/TagList'
|
|
|
import tools from '@/utils/tools'
|
|
|
- import {
|
|
|
- commonSend
|
|
|
- } from '@/api/conmmon.js'
|
|
|
+
|
|
|
import {
|
|
|
login
|
|
|
} from '@/api/login'
|
|
|
- import {
|
|
|
- GetUserPermission
|
|
|
- } from "@/api/user";
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
- components: {
|
|
|
- getCheckCode,tagList
|
|
|
- },
|
|
|
+
|
|
|
data() {
|
|
|
return {
|
|
|
checked: '',
|
|
|
num: 1,
|
|
|
loginForm: {
|
|
|
- phone: '',
|
|
|
+ account: '',
|
|
|
password: '',
|
|
|
- code: '',
|
|
|
- tabType: 0 // 0,密码登录 1,验证码登录
|
|
|
},
|
|
|
- tabData: [{
|
|
|
- title: '密码登录',
|
|
|
- 'type': 0
|
|
|
- }, {
|
|
|
- title: '验证码登录',
|
|
|
- 'type': 1
|
|
|
- }],
|
|
|
+
|
|
|
hobby: false,
|
|
|
passwordType: 'password',
|
|
|
styleType: 0,
|
|
|
- codeText: '获取验证码',
|
|
|
- time: 60,
|
|
|
+ swiperId:0,
|
|
|
+
|
|
|
carouselList: [{
|
|
|
url: require('@/assets/img/login/bg.png')
|
|
|
},
|
|
|
@@ -86,16 +60,13 @@
|
|
|
url: require('@/assets/img/login/bg-two.png')
|
|
|
}
|
|
|
],
|
|
|
- swiperId: 0,
|
|
|
- timer: ''
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.swiper()
|
|
|
},
|
|
|
- beforeDestroy() {
|
|
|
- clearInterval(this.timer)
|
|
|
- },
|
|
|
+
|
|
|
methods: {
|
|
|
swiper() {
|
|
|
this.timer = setInterval(() => {
|
|
|
@@ -105,25 +76,7 @@
|
|
|
}
|
|
|
}, 5000)
|
|
|
},
|
|
|
- getCode() {
|
|
|
- this.loginForm.smsType = "login"
|
|
|
- commonSend(this.loginForm).then((res) => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.popFun('成功', '获取短信验证码成功', 'success')
|
|
|
- const timer = setInterval(() => {
|
|
|
- this.time--
|
|
|
- this.codeText = this.time + '秒'
|
|
|
- if (this.time === 0) {
|
|
|
- this.time = 60
|
|
|
- clearInterval(timer)
|
|
|
- this.codeText = '获取验证码'
|
|
|
- }
|
|
|
- }, 5000)
|
|
|
- } else {
|
|
|
- tools.error(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
// 查看密码输入
|
|
|
showPwd() {
|
|
|
if (this.passwordType === 'password') {
|
|
|
@@ -132,36 +85,15 @@
|
|
|
this.passwordType = 'password'
|
|
|
}
|
|
|
},
|
|
|
- // tab切换
|
|
|
- tabSwitch(item) {
|
|
|
- this.styleType = item.type
|
|
|
- this.loginForm.tabType = item.type
|
|
|
- this.loginForm.phone = ''
|
|
|
- this.loginForm.password = ''
|
|
|
- },
|
|
|
- forget() {
|
|
|
- this.$router.push('/backPassword')
|
|
|
- },
|
|
|
+
|
|
|
toLogin() {
|
|
|
this.styleType = 0
|
|
|
if (this.verification()) {
|
|
|
- if (this.loginForm.tabType === 0) {
|
|
|
- delete this.loginForm.code
|
|
|
- } else {
|
|
|
- delete this.loginForm.password
|
|
|
- }
|
|
|
+
|
|
|
login(this.loginForm).then((res) => {
|
|
|
- if (res.code === 0) {
|
|
|
+ if (res.code === 1) {
|
|
|
tools.setLoginData(res.data)
|
|
|
- // this.$router.push('/')
|
|
|
- GetUserPermission().then((res) => {
|
|
|
- if (res.code === 0) {
|
|
|
- tools.setPermissionIds(res.data)
|
|
|
- this.$router.push('/')
|
|
|
- } else {
|
|
|
- this.$notify.error(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$router.push('/')
|
|
|
} else {
|
|
|
this.$notify.error(res.msg)
|
|
|
}
|
|
|
@@ -169,17 +101,7 @@
|
|
|
}
|
|
|
},
|
|
|
verification() {
|
|
|
- const reg_tel = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/
|
|
|
- if (this.loginForm.phone === '') {
|
|
|
- this.popFun('提示', '请输入手机号', 'error')
|
|
|
- this.styleType = 1
|
|
|
- return false
|
|
|
- }
|
|
|
- if (!reg_tel.test(this.loginForm.phone)) {
|
|
|
- this.popFun('提示', '请输入正确的手机号', 'error')
|
|
|
- this.styleType = 1
|
|
|
- return false
|
|
|
- }
|
|
|
+
|
|
|
if (this.loginForm.tabType === 0) {
|
|
|
if (this.loginForm.password === '') {
|
|
|
this.popFun('提示', '请输入密码', 'error')
|