修改登录页接口返回异常文字

This commit is contained in:
zhouyanli
2026-05-08 11:52:59 +08:00
parent b68766791d
commit 10505e8000
6 changed files with 16 additions and 40 deletions

View File

@@ -51,7 +51,7 @@ const smsCode = ref('');
// ========== 计算属性 ========== // ========== 计算属性 ==========
// 是否可点击确定按钮(密码格式正确 + 两次输入一致) // 是否可点击确定按钮(密码格式正确 + 两次输入一致)
const canConfirm = computed(() => { const canConfirm = computed(() => {
// 密码格式规则6-16位任意字符(可根据需求调整) // 密码格式规则6-16位任意字符
const pwdReg = /^(?=.*[a-zA-Z])(?=.*\d).{6,16}$/; const pwdReg = /^(?=.*[a-zA-Z])(?=.*\d).{6,16}$/;
// 校验条件:新密码符合格式 + 确认密码和新密码一致 + 均不为空 // 校验条件:新密码符合格式 + 确认密码和新密码一致 + 均不为空
return pwdReg.test(newPassword.value) return pwdReg.test(newPassword.value)
@@ -100,28 +100,12 @@ const handleConfirm = () => {
} }
}).catch(err =>{ }).catch(err =>{
uni.showToast({ uni.showToast({
title: '网络异常', title: err.msg,
icon: 'error' icon: 'error'
}); });
}) })
// 模拟修改密码请求
// uni.showLoading({
// title: '修改中...'
// });
// setTimeout(() => {
// uni.hideLoading();
// uni.showToast({
// title: '密码修改成功',
// icon: 'success'
// });
// // 密码修改成功后返回上一页(或跳转到登录页)
// uni.navigateTo({
// url:"/pages/login/pwd-login"
// });
// }, 1500);
}; };
</script> </script>

View File

@@ -90,6 +90,11 @@ const getVerifyCode = () => {
icon: 'error' icon: 'error'
}); });
} }
}).catch(err =>{
uni.showToast({
title: err.msg,
icon: 'error'
});
}) })

View File

@@ -31,14 +31,6 @@
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode" <uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode"
placeholder="请输入验证码" :inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle"> placeholder="请输入验证码" :inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle">
</uni-easyinput> </uni-easyinput>
<!-- <input
class="input-content verify-input"
type="number"
placeholder="请输入验证码"
v-model="verifyCode"
maxlength="6"
@input="checkForm"
/> -->
<button <button
class="get-verify-btn" class="get-verify-btn"
:disabled="!canGetVerify || countDown > 0" :disabled="!canGetVerify || countDown > 0"
@@ -95,13 +87,11 @@ const phoneNumber = ref('');
const verifyCode = ref(''); const verifyCode = ref('');
const placeholderStyle = ref('font-size:24rpx') const placeholderStyle = ref('font-size:24rpx')
// 是否同意协议 // 是否同意协议
const agreeAgreement = ref(false); // 默认勾选 const agreeAgreement = ref(false); // 默认勾选
// 倒计时(秒) // 倒计时(秒)
const countDown = ref(0); const countDown = ref(0);
// 定时器 // 定时器
let timer = null; let timer = null;
// 控制点击变色
// const isClicked = ref(false)
// ========== 计算属性 ========== // ========== 计算属性 ==========
// 是否可以获取验证码(手机号格式正确) // 是否可以获取验证码(手机号格式正确)
@@ -130,8 +120,6 @@ const toggleAgreement = () => {
}; };
// 跳转隐私协议 // 跳转隐私协议
const goToPrivacy = () => { const goToPrivacy = () => {
// 点击变色
// isClicked.value = true
uni.navigateTo({ uni.navigateTo({
url:'/pageSubPack/loginSub/privacy', url:'/pageSubPack/loginSub/privacy',
}) })
@@ -182,7 +170,7 @@ const handleLogin = () => {
uni.showLoading({ title: '登录中...', mask: true }); uni.showLoading({ title: '登录中...', mask: true });
let params = { let params = {
phone:phoneNumber.value, phone:phoneNumber.value,
smsCode:'123456', smsCode:verifyCode.value,
scene:'login', scene:'login',
} }
getLoginBySms(params).then(res =>{ getLoginBySms(params).then(res =>{

View File

@@ -155,7 +155,7 @@ const handleLogin = () => {
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: '网络异常', title: err.msg,
icon: 'error' icon: 'error'
}); });
}) })

View File

@@ -181,7 +181,7 @@
} }
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: '网路异常', title: err.msg,
icon: 'error' icon: 'error'
}); });
}) })
@@ -223,7 +223,7 @@
} }
}).catch((err) => { }).catch((err) => {
uni.showToast({ uni.showToast({
title: '网络异常', title: err.msg,
icon: 'error' icon: 'error'
}); });
}) })

View File

@@ -292,12 +292,11 @@ const previewImage = (url) => {
border: none; border: none;
} }
/* ========== 颜色的代码 ========== */ /* ========== 颜色的代码 ========== */
/* u-text__value u-text__value--main */
/* 激活的步骤标题 + 描述 强制蓝色 */ /* 激活的步骤标题 + 描述 强制蓝色 */
::v-deep .u-text__value .u-text__value--main { :deep(.u-steps-item__content--current .u-text__value--main) {
color: #007aff !important; color: #007aff !important;
} }
::v-deep .up-steps-item--active .up-steps-item__desc { :deep(.u-steps-item__content--current .u-text__value--tips) {
color: #007aff !important; color: #007aff !important;
} }