feat: 将注册手机号改为必填项

This commit is contained in:
TianyangZhang 2026-03-25 15:46:44 +08:00
parent 2edc9beef3
commit 72e7244ea0
3 changed files with 20 additions and 2 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 4.2.20 on 2026-03-25 07:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_verificationcode'),
]
operations = [
migrations.AlterField(
model_name='user',
name='phone',
field=models.CharField(max_length=20),
),
]

View File

@ -55,7 +55,7 @@ class User(AbstractUser):
('seeker', '求职者'),
]
role = models.CharField(max_length=20, choices=ROLE_CHOICES, default='seeker')
phone = models.CharField(max_length=20, blank=True)
phone = models.CharField(max_length=20)
organization = models.ForeignKey(
'organizations.Organization',
null=True, blank=True,

View File

@ -5,7 +5,7 @@
<el-form :model="form" @submit.prevent="handleRegister">
<el-form-item><el-input v-model="form.username" placeholder="用户名" /></el-form-item>
<el-form-item><el-input v-model="form.email" placeholder="邮箱" /></el-form-item>
<el-form-item><el-input v-model="form.phone" placeholder="手机号(可选)" /></el-form-item>
<el-form-item><el-input v-model="form.phone" placeholder="手机号" /></el-form-item>
<el-form-item><el-input v-model="form.password" type="password" placeholder="密码至少6位" show-password /></el-form-item>
<el-button type="primary" native-type="submit" :loading="loading" style="width:100%">注册</el-button>
</el-form>