Преглед на файлове

提示修改

娄底高职分支
王晓寒 преди 2 седмици
родител
ревизия
99a78dafdd
променени са 2 файла, в които са добавени 45 реда и са изтрити 32 реда
  1. +11
    -3
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs
  2. +34
    -29
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue

+ 11
- 3
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs Целия файл

@@ -73,7 +73,7 @@ namespace Learun.Application.WebApi
var isSend = GetAccountIsSendMsg(account.account);
if (!isSend.HasValue)
{
return Fail("请维护用户手机号信息");
return Fail("请检查登录账号信息");
}
return Success(new { sendresult = isSend });
}
@@ -86,7 +86,7 @@ namespace Learun.Application.WebApi
var account = this.GetReqData<UserAccount>();
var isSend = GetAccountIsSendMsg(account.account);
if (!isSend.HasValue)
return Fail("请维护用户手机号信息");
return Fail("请检查登录账号信息");

if (!isSend.Value)
return Fail("该用户不需要短信登录");
@@ -143,6 +143,14 @@ namespace Learun.Application.WebApi
private bool? GetAccountIsSendMsg(string account)
{
var userEntity = userIBLL.GetEntityByMobile(account);
if (userEntity==null)
{
userEntity = userIBLL.GetEntityByAccount(account);
if (userEntity==null)
{
return null;
}
}
//是否强密码验证
bool pwd = !string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true";
//是否发送短信
@@ -343,7 +351,7 @@ namespace Learun.Application.WebApi
return Fail(userEntity.LoginMsg);
}
if (!isSend.HasValue)
return Fail("请维护用户手机号信息");
return Fail("请检查登录账号信息");
if (isSend.Value)
{
if (string.IsNullOrEmpty(loginModel.verifycode))


+ 34
- 29
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue Целия файл

@@ -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 = {}


Зареждане…
Отказ
Запис