main
parent
661aa6cea7
commit
0c257a2a4c
|
|
@ -1,7 +1,7 @@
|
|||
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
||||
QyNTUxOQAAACA20GNyqm4LjDk1gVVnW1B8LnWw8pbZdDCwI+5wU4ishgAAAJAhuzaBIbs2
|
||||
gQAAAAtzc2gtZWQyNTUxOQAAACA20GNyqm4LjDk1gVVnW1B8LnWw8pbZdDCwI+5wU4ishg
|
||||
QyNTUxOQAAACA20GNyqm4LjDk1gVVnW1B8LnWw8pbZdDCwI+5wU4ishgAAAJDh6vD44erw
|
||||
+AAAAAtzc2gtZWQyNTUxOQAAACA20GNyqm4LjDk1gVVnW1B8LnWw8pbZdDCwI+5wU4ishg
|
||||
AAAECr8W4FkpVwEtReeKxc7PoSe3q089fPxreRPvGDI3+o9TbQY3KqbguMOTWBVWdbUHwu
|
||||
dbDyltl0MLAj7nBTiKyGAAAACllJX0xJVVlBTkcBAgM=
|
||||
-----END OPENSSH PRIVATE KEY-----
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@
|
|||
{{ countdown !== null ? `${countdown} 秒后重新发送` : '获取验证码' }}
|
||||
</button>
|
||||
</div>
|
||||
<button @click="verifyCodeAndLogin" :disabled="!isPhoneValid || !isVerificationCodeValid || countdown !== null">登录</button>
|
||||
<button @click="verifyCodeAndLogin"
|
||||
:disabled="!isPhoneValid || !isVerificationCodeValid || countdown !== null">登录</button>
|
||||
</div>
|
||||
|
||||
<div v-if="selectedTab === 'wechat'">
|
||||
|
|
@ -102,7 +103,7 @@ export default {
|
|||
console.error('解析来源网址时出错:', error);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// 微信扫码登录初始化
|
||||
|
|
@ -149,10 +150,10 @@ export default {
|
|||
phoneNumber: phone.value
|
||||
})
|
||||
.then(response => {
|
||||
if(response.data.code === '200'){
|
||||
if (response.data.code === '200') {
|
||||
console.log('验证码发送成功:', response.data);
|
||||
startCountdown(); // 开始倒计时
|
||||
}else{
|
||||
} else {
|
||||
console.log('验证码发送失败:', response.data);
|
||||
phoneError.value = response.data.message;
|
||||
}
|
||||
|
|
@ -169,24 +170,6 @@ export default {
|
|||
verificationCodeError.value = '请输入验证码';
|
||||
return false;
|
||||
}
|
||||
axios.post('https://api.sso.ycymedu.com/api/syswechat/smslogin', {
|
||||
phoneNumber: phone.value,
|
||||
code:verificationCode.value,
|
||||
redirect_uri:referer.value
|
||||
})
|
||||
.then(response => {
|
||||
if(response.data.code === '200'){
|
||||
console.log('验证码发送成功:', response.data);
|
||||
startCountdown(); // 开始倒计时
|
||||
}else{
|
||||
console.log('验证码发送失败:', response.data);
|
||||
phoneError.value = response.data.message;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('发送验证码失败:', error);
|
||||
phoneError.value = '发送验证码失败,请稍后再试';
|
||||
});
|
||||
verificationCodeError.value = ''; // 清除错误信息
|
||||
return true;
|
||||
});
|
||||
|
|
@ -250,7 +233,12 @@ export default {
|
|||
|
||||
// 登录函数
|
||||
const login = () => {
|
||||
if (selectedTab.value === 'password') {
|
||||
|
||||
switch (selectedTab.value) {
|
||||
case 'wechat':
|
||||
// 微信扫码登录
|
||||
break;
|
||||
case 'password':
|
||||
if (!isUsernameValid.value) {
|
||||
alert('请检查手机号');
|
||||
return;
|
||||
|
|
@ -260,7 +248,32 @@ export default {
|
|||
return;
|
||||
}
|
||||
alert('账号密码登录功能尚未实现');
|
||||
// 账号密码登录
|
||||
break;
|
||||
case 'phone':
|
||||
axios.post('https://api.sso.ycymedu.com/api/syswechat/smslogin', {
|
||||
phoneNumber: phone.value,
|
||||
code: verificationCode.value,
|
||||
redirect_uri: referer.value
|
||||
})
|
||||
.then(response => {
|
||||
if (response.data.code === '200') {
|
||||
console.log('验证码发送成功:', response.data);
|
||||
startCountdown(); // 开始倒计时
|
||||
} else {
|
||||
console.log('验证码发送失败:', response.data);
|
||||
phoneError.value = response.data.message;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('发送验证码失败:', error);
|
||||
phoneError.value = '发送验证码失败,请稍后再试';
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
return {
|
||||
|
|
@ -411,11 +424,11 @@ button:disabled {
|
|||
/* 水平居中 */
|
||||
}
|
||||
|
||||
.error-message {
|
||||
.error-message {
|
||||
color: red;
|
||||
font-size: 12px;
|
||||
margin-top: -10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue