commission--yt-commit
This commit is contained in:
@ -94,11 +94,11 @@ Page({
|
||||
async onRegister() {
|
||||
// 调用通用校验,失败时已提示并 return
|
||||
if (!validate(this.data, {
|
||||
nickname: '请输入昵称',
|
||||
phone: '请输入手机号',
|
||||
captcha: '请输入验证码',
|
||||
inviteCode: '请输入邀请码',
|
||||
password: '请输入密码'
|
||||
nickname: '昵称不能为空',
|
||||
phone: '手机号不能为空',
|
||||
captcha: '验证码不能为空',
|
||||
inviteCode: '邀请码不能为空',
|
||||
password: '密码不能为空'
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
@ -108,6 +108,10 @@ Page({
|
||||
return;
|
||||
}
|
||||
const { nickname, phone, captcha, inviteCode, password } = this.data;
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
const res = await requestAsync({
|
||||
url: baseUrl + '/userInfo/register',
|
||||
method: 'POST',
|
||||
@ -120,12 +124,14 @@ Page({
|
||||
userPassword: password
|
||||
}
|
||||
});
|
||||
console.log('注册信息---->',res.data);
|
||||
if (res.data.code === 1) {
|
||||
wx.showToast({
|
||||
title: '注册成功',
|
||||
icon: 'success',
|
||||
duration: 1000
|
||||
duration: 1000,
|
||||
});
|
||||
wx.hideLoading()
|
||||
setTimeout(() => {
|
||||
wx.navigateTo({
|
||||
url: '/pages/loginModule/pwdLogin/pwdLogin',
|
||||
@ -139,6 +145,7 @@ Page({
|
||||
title: res.data.message || '注册失败',
|
||||
icon: 'none'
|
||||
});
|
||||
wx.hideLoading()
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user