|
|
@@ -24,7 +24,7 @@
|
|
|
<p v-if="0" style="color:#f60;font-size:14px;margin-top:5px;margin-left:3px;">密码错误,请重新输入</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="box row center" v-if="needCode && showSecurityCode">
|
|
|
+ <div class="box row center" v-if="showSecurityCode">
|
|
|
<div class="boxData" :class="0?'errBd':''">
|
|
|
<input maxlength="6" @keyup.enter="loginBtn()" @blur="testCode()" type="text" v-model="securityCode" placeholder="验证码">
|
|
|
<img src="@/assets/img/password.png">
|
|
|
@@ -54,7 +54,6 @@
|
|
|
time:'',
|
|
|
loading:false,
|
|
|
showSecurityCode:false,
|
|
|
- needCode: 1, // 是否需要验证码验证
|
|
|
logo: '',
|
|
|
verifySystem:"",
|
|
|
verifySystemId:"",
|
|
|
@@ -64,12 +63,10 @@
|
|
|
},
|
|
|
methods:{
|
|
|
testCode(){
|
|
|
- if(this.needCode) {
|
|
|
- if(this.showSecurityCode){
|
|
|
- if (!(/^[0-9]+$/.test(this.securityCode))) {
|
|
|
- this.$message.error('验证码错误!')
|
|
|
- this.securityCode = '';
|
|
|
- }
|
|
|
+ if(this.showSecurityCode){
|
|
|
+ if (!(/^[0-9]+$/.test(this.securityCode))) {
|
|
|
+ this.$message.error('验证码错误!')
|
|
|
+ this.securityCode = '';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -90,7 +87,7 @@
|
|
|
// console.log(this.verifySystem)
|
|
|
// console.log(this.securityCode)
|
|
|
let parmas;
|
|
|
- if(this.needCode && this.showSecurityCode){
|
|
|
+ if(this.showSecurityCode){
|
|
|
parmas = {
|
|
|
username:this.account,
|
|
|
password:this.password,
|
|
|
@@ -100,11 +97,12 @@
|
|
|
parmas = {
|
|
|
username:this.account,
|
|
|
password:this.password,
|
|
|
- verifySystemId:this.verifySystemId ? this.verifySystemId : '',
|
|
|
- verifySystem:this.verifySystem ? this.verifySystem : '',
|
|
|
+ verifySystemId:this.verifySystemId,
|
|
|
+ verifySystem:this.verifySystem,
|
|
|
}
|
|
|
}
|
|
|
this.$http.post(this.$ports.login, parmas).then((res)=>{
|
|
|
+
|
|
|
if(res.data.code == 1){
|
|
|
this.$store.dispatch("SET_USER",res.data.data.user);
|
|
|
this.$store.dispatch("SET_IS_INIT",true);
|
|
|
@@ -159,33 +157,12 @@
|
|
|
this.$websocket.onopen();
|
|
|
//console.log('已经链接')
|
|
|
},
|
|
|
- getSecurityCode() { // 获取登录是否需要验证码
|
|
|
- let obj = {
|
|
|
- headers: {
|
|
|
- // 公共接口只需要传apitoken
|
|
|
- apiToken: this.$md5('getconfigs' + "customer-service" + 'index' + 'index'),
|
|
|
- }
|
|
|
- }
|
|
|
- this.$http.get(this.$ports.securityCode.getconfigs, obj).then(res => {
|
|
|
- if(res.data.code == 1) {
|
|
|
- this.needCode = res.data.data.checkcodeflag
|
|
|
- }
|
|
|
- else {
|
|
|
- this.$message.error(err.message)
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- this.$message.error(err.message)
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getSecurityCode();
|
|
|
},
|
|
|
mounted(){
|
|
|
// 判断验证码参数
|
|
|
let SystemId = this.$public.getQueryString("id");
|
|
|
let System = this.$public.getQueryString("code");
|
|
|
+
|
|
|
if( !SystemId && !System ){
|
|
|
this.showSecurityCode = true;
|
|
|
}else {
|
|
|
@@ -195,6 +172,12 @@
|
|
|
localStorage.clear();
|
|
|
sessionStorage.clear();
|
|
|
}
|
|
|
+ this.checkEnabled=this.$comm.checkValidCodeEnabled();
|
|
|
+ if(this.checkEnabled==0){
|
|
|
+ this.showSecurityCode = false;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
this.$http.get(this.$ports.TIME).then(res => {
|
|
|
if (res.data.code == 1) {
|
|
|
let time = res.data.data.time.split(' ');
|
|
|
@@ -204,11 +187,11 @@
|
|
|
sessionStorage.setItem("logo",res.data.data.logo);
|
|
|
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
// this.logo = sessionStorage.getItem('logo');
|
|
|
//console.log(this.logo, '========logo')
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|