调整登录逻辑退出登录调整拦截器新增路由通配404也买呢
This commit is contained in:
@@ -17,14 +17,17 @@
|
||||
<button class="sms-btn" type="default" size="mini" :disabled="phone == '' || getSms"
|
||||
@click="getPhoneCode">{{getSms ? '重新发送' + smsTime + 's': '发送验证码'}}</button>
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<input placeholder="邀请码" maxlength="10" v-model="parentId" />
|
||||
</view>
|
||||
<button class="btn" type="default" :disabled="phone == '' || code == ''" @click="login">登录</button>
|
||||
<!-- 快捷登录 -->
|
||||
<view class="quick">
|
||||
<!-- <view class="quick">
|
||||
<view class="quick-title">快捷登录</view>
|
||||
<view class="quick-box">
|
||||
<image class="quick-icon" src="@/static/icons/wechat.png" mode="widthFix" @click="onShowToast"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 用户登录注册协议 -->
|
||||
<view class="agreement">
|
||||
未注册的手机号验证后将自动创建账号,登录即表示同意接收
|
||||
@@ -32,6 +35,9 @@
|
||||
和
|
||||
<view @click="$Router.push({name: 'agreement', params: {name : 'service'}})">用户服务协议</view>
|
||||
</view>
|
||||
<view class="beianNo">皖ICP备2021013714号-1</view>
|
||||
|
||||
<!-- https://beian.miit.gov.cn/ -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -43,21 +49,34 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone: "18245180131",
|
||||
code: "",
|
||||
smsTime: 60,
|
||||
getSms: false
|
||||
phone : "18245180131",
|
||||
code : "",
|
||||
parentId: "",
|
||||
smsTime : 60,
|
||||
getSms : false
|
||||
}
|
||||
},
|
||||
onShow(){
|
||||
|
||||
console.log(this.$Route)
|
||||
|
||||
this.parentId = this.$Route.query.invite || ''
|
||||
},
|
||||
methods: {
|
||||
// 用户登录
|
||||
login() {
|
||||
smsAuth({
|
||||
mobileNo: this.phone,
|
||||
code: this.code
|
||||
mobileNo : this.phone,
|
||||
code : this.code,
|
||||
parent_id : this.parentId
|
||||
}).then(res => {
|
||||
this.$store.commit('setToken', res.token_type + ' ' + res.access_token)
|
||||
this.$Router.back()
|
||||
|
||||
if(this.$Route.toName){
|
||||
this.$Router.back()
|
||||
}else{
|
||||
this.$Router.replace({name: 'Index'})
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
@@ -111,7 +130,7 @@
|
||||
background: white;
|
||||
|
||||
.login-top {
|
||||
height: 36vh;
|
||||
height: 26vh;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -120,15 +139,12 @@
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
padding-bottom: 160rpx;
|
||||
|
||||
.top-bg {
|
||||
position: absolute;
|
||||
bottom: 30rpx;
|
||||
z-index: 2;
|
||||
width: 740rpx;
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
|
||||
.top-logo-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -185,8 +201,8 @@
|
||||
height: 77rpx;
|
||||
line-height: 77rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
top: 1rpx;
|
||||
right: 1rpx;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
@@ -253,7 +269,7 @@
|
||||
}
|
||||
|
||||
.agreement {
|
||||
padding-top: $padding * 2;
|
||||
padding-top: 12vh;
|
||||
font-size: $title-size-sm;
|
||||
color: $text-gray;
|
||||
view {
|
||||
@@ -262,5 +278,11 @@
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
}
|
||||
.beianNo{
|
||||
font-size: $title-size-sm;
|
||||
color: $text-gray-m;
|
||||
text-align: center;
|
||||
padding-top: $padding*2;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user