1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-26 20:52:44 +08:00

增强注册验证

This commit is contained in:
xiaochong0302 2025-03-24 23:14:13 +08:00
parent 76edeef591
commit 72deb17daa
5 changed files with 30 additions and 21 deletions

View File

@ -65,7 +65,7 @@
layer.open({
type: 2,
title: '推流测试',
area: ['720px', '500px'],
area: ['720px', '540px'],
content: [url, 'no']
});
});
@ -85,4 +85,4 @@
</script>
{% endblock %}
{% endblock %}

View File

@ -36,6 +36,8 @@ class Register extends LogicService
$accountValidator = new AccountValidator();
$accountValidator->checkRegisterStatus($post['account']);
$accountValidator->checkLoginName($post['account']);
$data = [];

View File

@ -129,6 +129,29 @@ class Account extends Validator
}
}
public function checkRegisterStatus($account)
{
$local = $this->getSettings('oauth.local');
$allowPhone = $local['register_with_phone'] ?? false;
$allowEmail = $local['register_with_email'] ?? false;
$isEmail = CommonValidator::email($account);
$isPhone = CommonValidator::Phone($account);
if (!$allowPhone && !$allowEmail) {
throw new BadRequestException('account.register_disabled');
}
if ($isPhone && !$allowPhone) {
throw new BadRequestException('account.register_with_phone_disabled');
}
if ($isEmail && !$allowEmail) {
throw new BadRequestException('account.register_with_email_disabled');
}
}
public function checkVerifyLogin($name, $code)
{
$this->checkLoginName($name);

View File

@ -57,6 +57,9 @@ $error['account.phone_taken'] = '手机号被占用';
$error['account.pwd_not_match'] = '密码不匹配';
$error['account.origin_pwd_incorrect'] = '原有密码不正确';
$error['account.login_pwd_incorrect'] = '登录密码不正确';
$error['account.register_disabled'] = '注册已关闭';
$error['account.register_with_phone_disabled'] = '手机注册已关闭';
$error['account.register_with_email_disabled'] = '邮箱注册已关闭';
/**
* 用户相关

View File

@ -14,21 +14,6 @@
padding-bottom: 0;
}
.layui-copyright {
position: fixed;
z-index: 999;
left: 0;
bottom: 0;
width: 180px;
padding: 10px;
font-size: 12px;
color: rgba(255, 255, 255, .7);
}
.layui-copyright a {
color: rgba(255, 255, 255, .7);
}
.red {
color: red;
}
@ -300,10 +285,6 @@ img.kg-qrcode {
border: 3px solid #999;
}
.kg-order-date {
margin-left: 30px;
}
.kg-order-item {
margin-top: 10px;
padding-top: 10px;