Commit 95b85ef1 by LJM

bug

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