更改验证码接口
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
<input v-model="code" type="number" maxlength="4" placeholder="输入验证码">
|
||||
<button :disabled="getSms" size="mini" @click="getPhoneCode()">{{sendCode}}</button>
|
||||
</view>
|
||||
<view class="auth-input">
|
||||
<input v-model="parentId" placeholder="输入邀请码">
|
||||
<view class="auth-input" v-if="isShowParent">
|
||||
<input v-model="parentId" placeholder="输入邀请码,选填">
|
||||
</view>
|
||||
<view class="auth-button">
|
||||
<button @click="login('code')">登录</button>
|
||||
@@ -32,16 +32,17 @@
|
||||
<script>
|
||||
import {
|
||||
smsAuth,
|
||||
getSms
|
||||
getInvitationSms
|
||||
} from '@/apis/interfaces/auth.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone : '',
|
||||
code : '',
|
||||
parentId: '',
|
||||
getSms : false,
|
||||
sendCode: '获取验证码'
|
||||
phone : '',
|
||||
code : '',
|
||||
parentId : '',
|
||||
getSms : false,
|
||||
sendCode : '获取验证码',
|
||||
isShowParent: false
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@@ -56,15 +57,16 @@
|
||||
})
|
||||
let outTime;
|
||||
let smsTime = 60;
|
||||
getSms({
|
||||
getInvitationSms({
|
||||
mobileNo: this.phone,
|
||||
}).then(res => {
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: res,
|
||||
title: res.message,
|
||||
icon: "none",
|
||||
});
|
||||
this.getSms = true;
|
||||
this.sendCode = smsTime + 's后重新获取';
|
||||
});
|
||||
this.isShowParent = res.is_show_parent
|
||||
this.getSms = true;
|
||||
this.sendCode = smsTime + 's后重新获取';
|
||||
outTime = setInterval(() => {
|
||||
if (smsTime <= 1) {
|
||||
this.getSms = false;
|
||||
|
||||
Reference in New Issue
Block a user