完成了登录模块
This commit is contained in:
@ -41,12 +41,16 @@ Page({
|
||||
}
|
||||
// 3. 请求验证码
|
||||
wx.request({
|
||||
url: baseUrl + '/userInfo/code',
|
||||
url: baseUrl + '/userInfo/code/pwd',
|
||||
method: 'POST',
|
||||
data: { templateString: phone },
|
||||
success: () => {
|
||||
wx.showToast({ title: '验证码已发送', icon: 'none' });
|
||||
this._startCountdown(60);
|
||||
success: (res) => {
|
||||
if (res.data.code === 1) {
|
||||
wx.showToast({ title: '验证码已发送', icon: 'none' });
|
||||
this._startCountdown(60);
|
||||
} else {
|
||||
wx.showToast({ title: res.data.message, icon: 'none' });
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.showToast({ title: '发送失败,请重试', icon: 'none' });
|
||||
@ -96,14 +100,14 @@ Page({
|
||||
newPwd: '请输入新密码',
|
||||
confirmPwd: '请再次输入新密码'
|
||||
})) return;
|
||||
// 2. 密码一致
|
||||
if (newPwd !== confirmPwd) {
|
||||
return wx.showToast({ title: '两次密码不一致', icon: 'none' });
|
||||
}
|
||||
// 3. 格式校验手机号
|
||||
if (!/^1\d{10}$/.test(phone)) {
|
||||
return wx.showToast({ title: '手机号格式不正确', icon: 'none' });
|
||||
}
|
||||
// 2. 密码一致
|
||||
if (newPwd !== confirmPwd) {
|
||||
return wx.showToast({ title: '两次密码不一致', icon: 'none' });
|
||||
}
|
||||
// 4. 发起重置请求
|
||||
wx.request({
|
||||
url: baseUrl + '/userInfo/mini/forgetPwd',
|
||||
|
@ -1,7 +1,7 @@
|
||||
<view class="flex-col page">
|
||||
<image
|
||||
class="self-center image"
|
||||
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=f8bf0cb3ec8201f89a31727a655c0709.png"
|
||||
src="https://img.picui.cn/free/2025/05/19/682a0dbe4085c.png"
|
||||
/>
|
||||
<text class="self-center text">欢迎登陆—青橙校园</text>
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
}
|
||||
.section_2 {
|
||||
margin-right: 4.42rpx;
|
||||
padding: 20.16rpx 16.88rpx 19.22rpx;
|
||||
padding: 25.16rpx 16.88rpx 24.22rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 9.38rpx;
|
||||
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
|
||||
|
Reference in New Issue
Block a user