feat: 调整

This commit is contained in:
Czw996 2022-05-07 15:14:30 +08:00
parent ca002f10d8
commit ef53cbed70
4 changed files with 8 additions and 4 deletions

View file

@ -80,7 +80,7 @@ class UserSerializer(BaseSerializer):
return instances
def create(self, validated_data):
validated_data['password'] = make_password(validated_data['username'])
validated_data['password'] = make_password('123456')
return super().create(validated_data)
def save(self, **kwargs):

View file

@ -111,7 +111,7 @@ class UserViewSet(ModelViewSet):
"""重置密码"""
instance = self.get_object()
instance.password = make_password(self.user.username)
instance.password = make_password('123456')
instance.save(update_fields=['password'])
return Response(status=status.HTTP_200_OK)

View file

@ -33,10 +33,10 @@
<div slot="action" slot-scope="value, item">
<a-button-group>
<a-button icon="edit" size="small" @click="targetItem = {...item}; visible = true;">编辑</a-button>
<a-popconfirm title="确定重置吗" @confirm="resetPassword(item.id)">
<a-popconfirm title="确定重置吗? 密码: 123456" @confirm="resetPassword(item.id)">
<a-button size="small" type="primary" icon="sync">重置密码</a-button>
</a-popconfirm>
<a-popconfirm title="确定删除吗" @confirm="destroy(item.id)">
<a-popconfirm title="确定删除吗?" @confirm="destroy(item.id)">
<a-button type="danger" icon="delete" size="small">删除</a-button>
</a-popconfirm>
</a-button-group>

View file

@ -38,6 +38,10 @@
</a-select>
</a-form-model-item>
</a-form-model>
<div style="color: rgb(255, 77, 79); text-align: center;">
默认初始密码为: 123456, 登录后请修改密码
</div>
</div>
</a-modal>
</div>