增加新功能
This commit is contained in:
+17
-5
@@ -55,7 +55,8 @@
|
||||
</view>
|
||||
|
||||
<view class="login_comm_but login_comm_but_yes" @click="loginFun">
|
||||
登录
|
||||
<up-loading-icon color="#FFFFFF" :show="butLoading"></up-loading-icon>
|
||||
<text style="margin-left: 10rpx;">登录</text>
|
||||
</view>
|
||||
<view class="cut_way_warp">
|
||||
<view v-if="loginWay === 'password'" @click="loginWay = 'code'">验证码登录</view>
|
||||
@@ -90,7 +91,7 @@
|
||||
import InputCodeComm from '@/components/code-comm/code-comm.vue';
|
||||
import { SMS_TYPE } from '@/utils/enumUtils.js';
|
||||
import { getUserList } from '@/api/common.js';
|
||||
import { loginbysms } from '@/api/login.js';
|
||||
import { loginbysms,loginbypw } from '@/api/auth.js';
|
||||
import { setStorageFun,TOKEN_NAME,USER_KEY,USER_DATA,USER_LOGIN_TIME } from '@/utils/auth.js';
|
||||
|
||||
export default {
|
||||
@@ -115,6 +116,7 @@
|
||||
isShow:false,// 是否显示
|
||||
isPolicy:false,// 是否同意
|
||||
countdown:false,// 清空倒计时
|
||||
butLoading:false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -142,9 +144,12 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.butLoading=true;
|
||||
let response={};
|
||||
if(this.loginWay === 'password'){
|
||||
|
||||
params.mobile = form.name;
|
||||
params.password = form.password;
|
||||
response = await loginbypw(params);
|
||||
}else{
|
||||
params.mobile = form.name;
|
||||
params.smsCode = form.code;
|
||||
@@ -158,24 +163,28 @@
|
||||
avatar:data.avatarUrl,
|
||||
name: data.name,
|
||||
userId: data.userId,
|
||||
grade:data.grade,
|
||||
inviteCode:data.inviteCode,
|
||||
};
|
||||
setStorageFun(USER_DATA,userInfo);
|
||||
// 当前登录得时间戳
|
||||
let currentTimeStamp = new Date().getTime();
|
||||
setStorageFun(USER_LOGIN_TIME,currentTimeStamp);
|
||||
this.butLoading=false;
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'success',
|
||||
message: response.msg,
|
||||
});
|
||||
|
||||
setTimeout(()=>{
|
||||
then.jumpHome();
|
||||
},2000);
|
||||
},
|
||||
checkNameParam(val){
|
||||
console.log("val",val);
|
||||
// console.log("val",val);
|
||||
},
|
||||
checkParam(val){
|
||||
console.log("val",val);
|
||||
// console.log("val",val);
|
||||
},
|
||||
/**
|
||||
* 获取手机验证码
|
||||
@@ -196,6 +205,7 @@
|
||||
type:SMS_TYPE.LOGIN,
|
||||
}
|
||||
const response = await getUserList(params);
|
||||
console.log("responseresponseresponse",response);
|
||||
if(response && response.bizcode === 100){
|
||||
this.$refs.uToastRef.show({
|
||||
type: 'success',
|
||||
@@ -243,6 +253,8 @@
|
||||
font-size: 32rpx;
|
||||
color: #999999;
|
||||
padding: 28rpx 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.login_comm_but_yes{
|
||||
background: $app-bt-bj;
|
||||
|
||||
Reference in New Issue
Block a user