注销 不能注册

This commit is contained in:
2025-12-08 12:06:53 +08:00
parent c10f055585
commit 7484817c82
5 changed files with 29 additions and 12 deletions

View File

@@ -110,6 +110,12 @@ class Login extends Controller
if (!$mobile) {
return V(0, '登录失败, 请更换登录方式!' );
}
//检测是否注销过
$config_time = get_system_config_value('cancel_no_login');
$is_del = db::name('user')->where(['mobile' => $mobile,'delete_time' => ['<>', 0]])->find();
if (time() - $is_del['delete_time'] < $config_time * 24 * 3600) {//30天内注销过
return V(0, '注销30天内不可操作。');
}
if(ctype_digit($mobile)){
$reslut = model('Login')->phone_verification_code_log($mobile,$system,$login_device);

View File

@@ -30,6 +30,14 @@ class Sms extends Api
if (!checkMobile($mobile)) {
return V(0, '手机号不正确');
}
//检测是否注销过
$config_time = get_system_config_value('cancel_no_login');
$is_del = db::name('user')->where(['mobile' => $mobile,'delete_time' => ['<>', 0]])->find();
if (time() - $is_del['delete_time'] < $config_time * 24 * 3600) {//30天内注销过
return V(0, '注销30天内不可操作。');
}
//频率控制
$last = db::name('sms')->where(['mobile' => $mobile, 'event' => $event])->order('id', 'DESC')->find();
if ($last && time() - $last['createtime'] < 60) {