|
|
@@ -27,7 +27,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 账户密码表单 --> |
|
|
|
<l-input v-if="ready" v-model="username" @blur="getNeedCode" placeholder="账号" left> |
|
|
|
<l-input v-if="ready" v-model="username" @blur="getNeedCode" placeholder="手机号" left> |
|
|
|
<l-icon slot="title" type="people" /> |
|
|
|
</l-input> |
|
|
|
<l-input v-if="ready" v-model="password" placeholder="请输入密码" password left> |
|
|
@@ -37,7 +37,8 @@ |
|
|
|
<l-icon slot="title" type="lock" /> |
|
|
|
<template #suffix> |
|
|
|
<view style="margin-top: 4px;color: #606266;"> |
|
|
|
<text :style="{color:time==0?'#409EFF':'#999'}" @click="time==0&&sendCode()">{{hasSendCode?'重新发送':'发送验证码'}}</text> |
|
|
|
<text :style="{color:time==0?'#409EFF':'#999'}" |
|
|
|
@click="time==0&&sendCode()">{{hasSendCode?'重新发送':'发送验证码'}}</text> |
|
|
|
{{time?'('+time+ 's'+')' :''}} |
|
|
|
</view> |
|
|
|
</template> |
|
|
@@ -62,8 +63,8 @@ |
|
|
|
|
|
|
|
<!-- 【仅小程序】一键登录按钮 --> |
|
|
|
<!-- #ifdef MP --> |
|
|
|
<l-button v-if="MPLogin" @click="login(PLATFORM)" size="lg" line="green" |
|
|
|
class="margin-top-sm block" block> |
|
|
|
<l-button v-if="MPLogin" @click="login(PLATFORM)" size="lg" line="green" class="margin-top-sm block" |
|
|
|
block> |
|
|
|
{{ PLATFORM_TEXT }}一键登录 |
|
|
|
</l-button> |
|
|
|
<!-- #endif --> |
|
|
@@ -101,10 +102,10 @@ |
|
|
|
devAccountList: [], |
|
|
|
|
|
|
|
resData: {}, |
|
|
|
loginResult:{}, |
|
|
|
logininfo:{}, |
|
|
|
loginResult: {}, |
|
|
|
logininfo: {}, |
|
|
|
needCode: false, |
|
|
|
hasSendCode:false, |
|
|
|
hasSendCode: false, |
|
|
|
mobile: '', |
|
|
|
verifycode: '', |
|
|
|
time: 0, |
|
|
@@ -210,7 +211,7 @@ |
|
|
|
if (!type && !check()) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.needCode&&!this.verifycode) { |
|
|
|
if (this.needCode && !this.verifycode) { |
|
|
|
this.TOAST('请输入验证码'); |
|
|
|
return |
|
|
|
} |
|
|
@@ -231,10 +232,10 @@ |
|
|
|
username, |
|
|
|
password: this.MD5(password), |
|
|
|
up: up, |
|
|
|
verifycode:this.verifycode||undefined |
|
|
|
verifycode: this.verifycode || undefined |
|
|
|
}) |
|
|
|
if (postResult[1].data.code == '200') { |
|
|
|
if(postResult[1].data.data.sendresult){ |
|
|
|
if (postResult[1].data.data.sendresult) { |
|
|
|
// this.TOAST(postResult[1].data.data.msg); |
|
|
|
this.HIDE_LOADING() |
|
|
|
this.needCode = true |
|
|
@@ -251,7 +252,7 @@ |
|
|
|
this.username = "" |
|
|
|
this.password = "" |
|
|
|
this.verifycode = "" |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
this.TOAST(postResult[1].data.info); |
|
|
|
} |
|
|
@@ -300,7 +301,7 @@ |
|
|
|
user |
|
|
|
} |
|
|
|
this.HIDE_LOADING() |
|
|
|
|
|
|
|
|
|
|
|
this.SET_GLOBAL('token', this.resData.token) |
|
|
|
this.SET_GLOBAL('loginUser', this.resData.user) |
|
|
|
this.SET_STORAGE("logintime", this.resData.user.logTime); |
|
|
@@ -312,15 +313,15 @@ |
|
|
|
if (this.loginResult.pwd === true) { |
|
|
|
this.SET_STORAGE('pwd', true); |
|
|
|
this.TOAST("您的密码不满足强度要求,请您先修改密码后再执行系统其他操作"); |
|
|
|
setTimeout(()=>{ |
|
|
|
setTimeout(() => { |
|
|
|
this.NAV_TO('/pages/my/newpassword') |
|
|
|
},1000) |
|
|
|
}, 1000) |
|
|
|
return; |
|
|
|
} else { |
|
|
|
this.SET_STORAGE('pwd', false); |
|
|
|
this.TAB_TO('/pages/home') |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// // 如果没发短信直接登录 |
|
|
|
// if(!this.loginResult.sendresult){ |
|
|
|
// this.checkverifycode(false) |
|
|
@@ -342,14 +343,16 @@ |
|
|
|
// }, 1000); |
|
|
|
}, |
|
|
|
// 获取是否需要验证码 |
|
|
|
getNeedCode(){ |
|
|
|
if(!this.username)return |
|
|
|
this.POST('learun/adms/user/loginverify',{account:this.username}).then(res=>{ |
|
|
|
getNeedCode() { |
|
|
|
if (!this.username) return |
|
|
|
this.POST('learun/adms/user/loginverify', { |
|
|
|
account: this.username |
|
|
|
}).then(res => { |
|
|
|
if (res[1].data.code != '200') { |
|
|
|
this.TOAST(res[1].data.info); |
|
|
|
return |
|
|
|
} |
|
|
|
if(res[1].data.data.sendresult){ |
|
|
|
if (res[1].data.data.sendresult) { |
|
|
|
this.needCode = true |
|
|
|
} |
|
|
|
}) |
|
|
@@ -368,15 +371,17 @@ |
|
|
|
return true |
|
|
|
}, |
|
|
|
// 发送验证码 |
|
|
|
sendCode(){ |
|
|
|
sendCode() { |
|
|
|
this.LOADING() |
|
|
|
this.HTTP_POST('learun/adms/user/sendmsg',{account:this.username}).then(res=>{ |
|
|
|
this.HTTP_POST('learun/adms/user/sendmsg', { |
|
|
|
account: this.username |
|
|
|
}).then(res => { |
|
|
|
this.HIDE_LOADING() |
|
|
|
if(!res){ |
|
|
|
if (!res) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.TOAST(res.msg); |
|
|
|
if(!res.sendstate)return |
|
|
|
if (!res.sendstate) return |
|
|
|
this.hasSendCode = true |
|
|
|
this.time = 60 |
|
|
|
this.timeT = setInterval(() => { |
|
|
@@ -390,8 +395,8 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 验证码校验 |
|
|
|
async checkverifycode(needCheck=true) { |
|
|
|
if(needCheck){ |
|
|
|
async checkverifycode(needCheck = true) { |
|
|
|
if (needCheck) { |
|
|
|
if (!this.verifycode) { |
|
|
|
this.TOAST('请输入验证码'); |
|
|
|
return |
|
|
@@ -426,16 +431,16 @@ |
|
|
|
if (this.loginResult.pwd === true) { |
|
|
|
this.SET_STORAGE('pwd', true); |
|
|
|
this.TOAST("您的密码不满足强度要求,请您先修改密码后再执行系统其他操作"); |
|
|
|
setTimeout(()=>{ |
|
|
|
setTimeout(() => { |
|
|
|
this.NAV_TO('/pages/my/newpassword') |
|
|
|
},1000) |
|
|
|
}, 1000) |
|
|
|
return; |
|
|
|
} else { |
|
|
|
this.SET_STORAGE('pwd', false); |
|
|
|
this.TAB_TO('/pages/home') |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
toLogin() { |
|
|
|
this.resData = {} |
|
|
|