修改验证短信
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
"name" : "花开物业",
|
"name" : "花开物业",
|
||||||
"appid" : "__UNI__29C3D60",
|
"appid" : "__UNI__29C3D60",
|
||||||
"description" : "智慧社区居民端面向小区业主使用,支持注册、验证码、账号密码多种登录方式,提供密码找回功能,账号使用安全便捷。支持多小区切换,首页设有轮播 banner、社区公告,集成远程开门、生活缴费、在线报修、访客邀请、社区活动常用服务。全服务板块统一涵盖门禁开门、线上缴费、报修申报、访客预约、投诉反馈、问卷调研、活动报名、社区公示、一键联系物业功能。个人中心可管理房屋、住户、车位、车辆信息,支持更换手机号、修改密码、消息通知设置、版本更新及账号退出,一站式满足业主居家生活、社区服务、房产车辆管理需求,实现社区生活数字化、便捷化。",
|
"description" : "智慧社区居民端面向小区业主使用,支持注册、验证码、账号密码多种登录方式,提供密码找回功能,账号使用安全便捷。支持多小区切换,首页设有轮播 banner、社区公告,集成远程开门、生活缴费、在线报修、访客邀请、社区活动常用服务。全服务板块统一涵盖门禁开门、线上缴费、报修申报、访客预约、投诉反馈、问卷调研、活动报名、社区公示、一键联系物业功能。个人中心可管理房屋、住户、车位、车辆信息,支持更换手机号、修改密码、消息通知设置、版本更新及账号退出,一站式满足业主居家生活、社区服务、房产车辆管理需求,实现社区生活数字化、便捷化。",
|
||||||
"versionName" : "1.2.2",
|
"versionName" : "1.2.3",
|
||||||
"versionCode" : 136,
|
"versionCode" : 137,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"uniCloud" : {
|
"uniCloud" : {
|
||||||
"provider" : "aliyun",
|
"provider" : "aliyun",
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ export const getLoginBySms = (data) =>{
|
|||||||
export const getResetPassword = (data) =>{
|
export const getResetPassword = (data) =>{
|
||||||
return post('/api/resident/auth/resetPassword',data)
|
return post('/api/resident/auth/resetPassword',data)
|
||||||
}
|
}
|
||||||
|
// 忘记密码 校验短信验证码
|
||||||
|
export const verifySmsCode = (data) =>{
|
||||||
|
return post('/api/resident/auth/verifySmsCode',data)
|
||||||
|
}
|
||||||
// =========首页=======
|
// =========首页=======
|
||||||
// 获取bannar图
|
// 获取bannar图
|
||||||
export const getBannarList = (data) =>{
|
export const getBannarList = (data) =>{
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { navigateToLogin } from '@/common/checkLogin.js'
|
|||||||
|
|
||||||
let baseUrl = '';
|
let baseUrl = '';
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// baseUrl = 'http://192.168.1.6:8080'; // 开发环境
|
baseUrl = 'http://192.168.1.6:8080'; // 开发环境
|
||||||
baseUrl = 'http://192.168.1.222:8080';
|
// baseUrl = 'http://192.168.1.222:8080';
|
||||||
} else {
|
} else {
|
||||||
baseUrl = 'https://wuyeapi.ckdzkj.com'; // 生产环境
|
baseUrl = 'https://wuyeapi.ckdzkj.com'; // 生产环境
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="reset-pwd-page">
|
<view class="reset-pwd-page">
|
||||||
<view class="status_bar"></view>
|
|
||||||
<!-- 顶部导航栏 -->
|
|
||||||
<!-- <view class="nav-bar">
|
|
||||||
<uni-icons type="left" size="28" color="#333" @click="goBack"></uni-icons>
|
|
||||||
<view class="nav-title">修改密码</view>
|
|
||||||
</view> -->
|
|
||||||
|
|
||||||
<!-- 密码提示 -->
|
|
||||||
<view class="pwd-tips">密码为 6-16 位,需同时包含字母和数字</view>
|
|
||||||
|
|
||||||
<!-- 新密码输入框 -->
|
<!-- 新密码输入框 -->
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<uni-easyinput class="input-content" type="password" v-model="newPassword"
|
<uni-easyinput class="input-content" type="password" v-model="newPassword"
|
||||||
placeholder="请输入密码" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle">
|
placeholder="请输入密码" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle">
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 密码提示 -->
|
||||||
|
<view class="pwd-tips">密码为 6-16 位,需同时包含字母和数字</view>
|
||||||
|
|
||||||
<!-- 确认密码输入框 -->
|
<!-- 确认密码输入框 -->
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
@@ -148,7 +142,7 @@ const handleConfirm = () => {
|
|||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 10rpx;
|
||||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -179,10 +173,10 @@ const handleConfirm = () => {
|
|||||||
|
|
||||||
/* 密码提示 */
|
/* 密码提示 */
|
||||||
.pwd-tips {
|
.pwd-tips {
|
||||||
font-size: 24rpx;
|
font-size: 16rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
padding-left: 10rpx;
|
padding-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 确定按钮 */
|
/* 确定按钮 */
|
||||||
|
|||||||
@@ -16,30 +16,27 @@
|
|||||||
</view>
|
</view>
|
||||||
<input class="input-content verify-input native-input" :type="inputType" v-model="verifyCode"
|
<input class="input-content verify-input native-input" :type="inputType" v-model="verifyCode"
|
||||||
placeholder="请输入验证码" maxlength="6" placeholder-style="font-size:24rpx"/>
|
placeholder="请输入验证码" maxlength="6" placeholder-style="font-size:24rpx"/>
|
||||||
<button
|
<button class="get-verify-btn" :disabled="!canGetVerify || countDown > 0"
|
||||||
class="get-verify-btn"
|
@click="getVerifyCode">
|
||||||
:disabled="!canGetVerify || countDown > 0"
|
|
||||||
@click="getVerifyCode"
|
|
||||||
>
|
|
||||||
{{ countDown > 0 ? `${countDown}s后重新获取` : '获取验证码' }}
|
{{ countDown > 0 ? `${countDown}s后重新获取` : '获取验证码' }}
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
<!-- 下一步 -->
|
<!-- 下一步 -->
|
||||||
<button
|
<button
|
||||||
class="forget-btn"
|
class="forget-btn"
|
||||||
:disabled="!canRegister"
|
:disabled="!canRegister || submitting"
|
||||||
@click="handleNext"
|
@click="handleNext"
|
||||||
>
|
>
|
||||||
下一步
|
{{ submitting ? '校验中...' : '下一步' }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onUnmounted } from 'vue';
|
import { ref, computed, onUnmounted } from 'vue';
|
||||||
import {getSendCode} from '../api/api.js'
|
import {getSendCode,verifySmsCode} from '../api/api.js'
|
||||||
|
|
||||||
// 输入框类型:统一用 text,避免 number 在真机上把 -/. 过滤掉导致手机号被误判合法;非法手机号由 canGetVerify 禁用获取验证码按钮
|
// 输入框类型:统一用 text
|
||||||
const inputType = 'text'
|
const inputType = 'text'
|
||||||
|
|
||||||
// ====响应式数据======
|
// ====响应式数据======
|
||||||
@@ -47,6 +44,7 @@ const phoneNumber = ref('')
|
|||||||
const verifyCode = ref('')
|
const verifyCode = ref('')
|
||||||
|
|
||||||
const countDown = ref(0)
|
const countDown = ref(0)
|
||||||
|
const submitting = ref(false)
|
||||||
let timer = null;
|
let timer = null;
|
||||||
const placeholderStyle = ref('font-size:24rpx')
|
const placeholderStyle = ref('font-size:24rpx')
|
||||||
|
|
||||||
@@ -105,18 +103,34 @@ const canRegister = computed(() => {
|
|||||||
});
|
});
|
||||||
// 下一步
|
// 下一步
|
||||||
const handleNext = () =>{
|
const handleNext = () =>{
|
||||||
|
if(!canRegister.value){
|
||||||
|
uni.showToast({ title: '请输入正确的手机号和验证码', icon: 'none'});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(submitting.value) return
|
||||||
|
submitting.value = true
|
||||||
|
// 后端验证短信
|
||||||
|
verifySmsCode({
|
||||||
|
phone: phoneNumber.value,
|
||||||
|
smsCode: verifyCode.value,
|
||||||
|
scene: 'reset'
|
||||||
|
}).then(res =>{
|
||||||
// 把参数存到本地缓存
|
// 把参数存到本地缓存
|
||||||
uni.setStorageSync('tempChangePwdParams', {
|
uni.setStorageSync('tempChangePwdParams', {
|
||||||
phoneNumber:phoneNumber.value,
|
phoneNumber:phoneNumber.value,
|
||||||
verifyCode: verifyCode.value
|
verifyCode: verifyCode.value
|
||||||
});
|
});
|
||||||
if(!canRegister.value){
|
|
||||||
uni.showToast({ title: '请输入',icon: 'error'});
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pageSubPack/loginSub/change-pwd'
|
url: '/pageSubPack/loginSub/change-pwd'
|
||||||
});
|
});
|
||||||
|
}).catch(err =>{
|
||||||
|
uni.showToast({
|
||||||
|
title: err.msg || '验证码错误',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}).finally(() =>{
|
||||||
|
submitting.value = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 返回上一页
|
// 返回上一页
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ const fetchDetail = async (id) => {
|
|||||||
uni.showToast({ title: res.msg || '获取详情失败', icon: 'none' })
|
uni.showToast({ title: res.msg || '获取详情失败', icon: 'none' })
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
uni.showToast({ title: '网络异常', icon: 'none' })
|
uni.showToast({ title: e.msg || '网络异常', icon: 'none' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user