Commit 95b85ef1 by LJM

bug

parent 5ffe1914
......@@ -307,7 +307,6 @@ export default {
closetab(path) {
let tab_arr = JSON.parse(sessionStorage.getItem('tabs'))
for (var i = 0; i < tab_arr.length; i++) {
if (tab_arr[i].path == path) {
tab_arr.splice(i, 1);
sessionStorage.setItem('tabs', JSON.stringify(tab_arr));
......@@ -507,6 +506,7 @@ export default {
&.first {
background-color: transparent;
&::after {
display: none;
}
......
......@@ -116,6 +116,7 @@ export default {
},
//取消发货
cancelSend() {
var self = this;
if (this.multipleSelection.length <= 0) {
this.$message({
message: "请勾选数据进行操作",
......@@ -148,7 +149,7 @@ export default {
type: 'success',
duration: 2000,
onClose() {
this.getData();
self.getData();
}
});
} else {
......
<template>
<div class="user-box">
<div class="head-box">
<div class="head-wrap lbBox">
<a class="logo lineBlock va-m">
<img src="../../assets/images/logo.png" alt=""/>
</a>
<span class="line lineBlock va-m"></span>
<div class="text lineBlock va-m">
<p class="t1">猎芯云芯商家</p>
<p class="t2">连接终端需求</p>
</div>
<b class="lineBlock emptys"></b>
</div>
<div class="user-box">
<div class="head-box">
<div class="head-wrap lbBox">
<a class="logo lineBlock va-m">
<img src="../../assets/images/logo.png" alt=""/>
</a>
<span class="line lineBlock va-m"></span>
<div class="text lineBlock va-m">
<p class="t1">猎芯云芯商家</p>
<p class="t2">连接终端需求</p>
</div>
<div class="section">
<div class="section-wrap">
<div class="login-box">
<p class="tit">欢迎登录云芯系统</p>
<div class="bar">
<form>
<div class="input-box lbBox" :class="errorClass1 ? 'error':''">
<i class="iconfont iconuser va-m"></i>
<input type="text" placeholder="请输入手机号" class="inp va-m" v-model="form.mobile" autocomplete="off"/>
<b class="lineBlock emptys"></b>
</div>
<div class="input-box lbBox" :class="errorClass2 ? 'error':''">
<i class="iconfont icondenglu-mimabeifen va-m"></i>
<input :type='pwdFlag?"password":"text"' placeholder="请输入登录密码" class="inp va-m" v-model="form.password"/>
<a href="javascript:;" class="iconfont eye" :class="pwdFlag ? 'iconyincang':'iconyanjing'" @click="changePwd()"></a>
<b class="lineBlock emptys"></b>
</div>
<div class="code-box clr" :class="errorClass3 ? 'error':''">
<div class="fl l">
<input type="text" placeholder="请输入验证码" v-model="form.captcha"/>
</div>
<a class="fr r" href="javascript:;" title="换一张" @click="updateCp()">
<img :src="imgSrc" alt="">
</a>
</div>
<p class="text">
<span class="error">{{errror_text}}</span>
<a href="javascript:;" style="visibility:hidden;">忘记密码</a>
</p>
<a href="javascript:;" class="btn-submit" :class="active ? 'active':''" @click="submit()" :loading="true">登录</a>
</form>
</div>
<b class="lineBlock emptys"></b>
</div>
</div>
<div class="section">
<div class="section-wrap">
<div class="login-box">
<p class="tit">欢迎登录云芯系统</p>
<div class="bar">
<form>
<div class="input-box lbBox" :class="errorClass1 ? 'error':''">
<i class="iconfont iconuser va-m"></i>
<input type="text" placeholder="请输入手机号" class="inp va-m" v-model="form.mobile" autocomplete="off"/>
<b class="lineBlock emptys"></b>
</div>
<div class="input-box lbBox" :class="errorClass2 ? 'error':''">
<i class="iconfont icondenglu-mimabeifen va-m"></i>
<input :type='pwdFlag?"password":"text"' placeholder="请输入登录密码" class="inp va-m" v-model="form.password"/>
<a href="javascript:;" class="iconfont eye" :class="pwdFlag ? 'iconyincang':'iconyanjing'" @click="changePwd()"></a>
<b class="lineBlock emptys"></b>
</div>
<div class="code-box clr" :class="errorClass3 ? 'error':''">
<div class="fl l">
<input type="text" placeholder="请输入验证码" v-model="form.captcha"/>
</div>
</div>
<a class="fr r" href="javascript:;" title="换一张" @click="updateCp()">
<img :src="imgSrc" alt="">
</a>
</div>
<p class="text">
<span class="error">{{ errror_text }}</span>
<a href="javascript:;" style="visibility:hidden;">忘记密码</a>
</p>
<a href="javascript:;" class="btn-submit" :class="active ? 'active':''" @click="submit()" :loading="true">登录</a>
</form>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import {Loading, Message} from 'element-ui';
import Util from "../../tool";
Vue.prototype.$message=Message
export default {
name: "index",
data() {
return {
pwdFlag: true,
active: false,
errror_text: '',
status1: false,
status2: false,
loading: true,
imgSrc: '',
errorClass1: false,
errorClass2: false,
errorClass3: false,
cp: false,
form: {
mobile: '',
password: '',
captcha: '',
captcha_key: ''
}
};
},
watch: {
import Vue from 'vue';
import {Loading, Message} from 'element-ui';
import Util from "../../tool";
Vue.prototype.$message = Message
export default {
name: "index",
data() {
return {
pwdFlag: true,
active: false,
errror_text: '',
status1: false,
status2: false,
loading: true,
imgSrc: '',
errorClass1: false,
errorClass2: false,
errorClass3: false,
cp: false,
form: {
deep: true,
handler: function (newV, oldV) {
let obj = newV;
let myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
mobile: '',
password: '',
captcha: '',
captcha_key: ''
}
};
},
watch: {
form: {
deep: true,
handler: function (newV, oldV) {
let obj = newV;
let myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
if (!this.cp) {
if (obj.captcha || obj.password || obj.mobile) {
this.errror_text = '';
this.errorClass1 = false;
this.errorClass2 = false;
this.errorClass3 = false;
}
} else {
this.cp = false;
if (!this.cp) {
if (obj.captcha || obj.password || obj.mobile) {
this.errror_text = '';
this.errorClass1 = false;
this.errorClass2 = false;
this.errorClass3 = false;
}
} else {
this.cp = false;
}
if (myreg.test(obj.mobile)) {
this.active = true;
} else {
this.active = false;
}
if (myreg.test(obj.mobile)) {
this.active = true;
} else {
this.active = false;
}
}
}
},
created() {
this.updateCp();
},
computed: {},
methods: {
updateCp() {
this.$http('get', "/auth/cp").then(res => {
if (res.code === 0) {
this.imgSrc = res.data.url.img;
this.form.captcha_key = res.data.url.key;
}
}).catch(err => {
console.log(err.message);
})
},
created() {
this.updateCp();
changePwd: function () {
this.pwdFlag = !this.pwdFlag;
},
computed: {},
methods: {
updateCp() {
this.$http('get', "/auth/cp").then(res => {
if (res.code === 0) {
this.imgSrc = res.data.url.img;
this.form.captcha_key = res.data.url.key;
}
}).catch(err => {
console.log(err.message);
})
},
changePwd: function () {
this.pwdFlag = !this.pwdFlag;
},
submit() {
var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
if (!this.form.mobile) {
this.errror_text = '请输入手机号';
this.errorClass1 = true;
return false;
}
if (!myreg.test(this.form.mobile)) {
this.errror_text = '请输入正确的手机号';
this.errorClass1 = true;
return false;
}
submit() {
var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
if (!this.form.mobile) {
this.errror_text = '请输入手机号';
this.errorClass1 = true;
return false;
}
if (!myreg.test(this.form.mobile)) {
this.errror_text = '请输入正确的手机号';
this.errorClass1 = true;
return false;
}
if (!this.form.password) {
this.errror_text = '请输入登录密码';
this.errorClass2 = true;
return false;
}
if (!this.form.captcha) {
this.errror_text = '请输入验证码';
this.errorClass3 = true;
return false;
}
if (!this.form.password) {
this.errror_text = '请输入登录密码';
this.errorClass2 = true;
return false;
}
if (!this.form.captcha) {
this.errror_text = '请输入验证码';
this.errorClass3 = true;
return false;
}
let loadingInstance = Loading.service({
background: 'rgba(0, 0, 0, 0)'
});
let loadingInstance = Loading.service({
background: 'rgba(0, 0, 0, 0)'
});
this.$http('post', "/auth/login", {
mobile: this.form.mobile,
password: this.form.password,
captcha: this.form.captcha,
captcha_key: this.form.captcha_key
}).then(res => {
loadingInstance.close();
if (res.code === 0) {
Util.setCookie("token", res.data.api_token, 1);
//强制要求微信绑定
if (!res.data.is_bind_wechat) {
this.$http('get', "/api/login/getwxqrcode").then(res => {
if (res.code === 0) {
window.location.href = res.data.wx_login_url;
} else {
this.$message(res.msg);
}
})
} else {
if (this.$route.query.referer) {
window.location.href = "/#" + this.$route.query.referer
this.$http('post', "/auth/login", {
mobile: this.form.mobile,
password: this.form.password,
captcha: this.form.captcha,
captcha_key: this.form.captcha_key
}).then(res => {
loadingInstance.close();
if (res.code === 0) {
sessionStorage.removeItem('tabs');
Util.setCookie("token", res.data.api_token, 1);
//强制要求微信绑定
if (!res.data.is_bind_wechat) {
this.$http('get', "/api/login/getwxqrcode").then(res => {
if (res.code === 0) {
window.location.href = res.data.wx_login_url;
} else {
window.location.href = '/';
this.$message(res.msg);
}
}
} else if (res.code === 102) {
this.errror_text = res.msg;
//this.errorClass3 = true;
this.cp = true;
this.updateCp();
this.$message(res.msg);
})
} else {
this.errror_text = res.msg;
this.cp = true;
this.$message(res.msg);
this.updateCp();
if (this.$route.query.referer) {
window.location.href = "/#" + this.$route.query.referer
} else {
window.location.href = '/';
}
}
}).catch(err => {
loadingInstance.close();
});
} else if (res.code === 102) {
this.errror_text = res.msg;
//this.errorClass3 = true;
this.cp = true;
this.updateCp();
this.$message(res.msg);
} else {
this.errror_text = res.msg;
this.cp = true;
this.$message(res.msg);
this.updateCp();
}
}).catch(err => {
loadingInstance.close();
});
}
}
};
}
};
</script>
<style scoped>
@import "../../assets/css/login/index.min.css";
@import "../../assets/css/login/index.min.css";
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment