Merge pull request #781 from 1Panel-dev/pr@main@refactor_user
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

refactor: user
This commit is contained in:
wxg0103 2024-07-16 16:21:51 +08:00 committed by GitHub
commit ca1c36ab5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -497,7 +497,7 @@ class UserSerializer(ApiMixin, serializers.ModelSerializer):
class UserInstanceSerializer(ApiMixin, serializers.ModelSerializer):
class Meta:
model = User
fields = ['id', 'username', 'email', 'phone', 'is_active', 'role', 'nick_name', 'create_time', 'update_time']
fields = ['id', 'username', 'email', 'phone', 'is_active', 'role', 'nick_name', 'create_time', 'update_time', 'source']
@staticmethod
def get_response_body_api():
@ -512,6 +512,7 @@ class UserInstanceSerializer(ApiMixin, serializers.ModelSerializer):
'phone': openapi.Schema(type=openapi.TYPE_STRING, title="手机号", description="手机号"),
'is_active': openapi.Schema(type=openapi.TYPE_BOOLEAN, title="是否激活", description="是否激活"),
'role': openapi.Schema(type=openapi.TYPE_STRING, title="角色", description="角色"),
'source': openapi.Schema(type=openapi.TYPE_STRING, title="来源", description="来源"),
'nick_name': openapi.Schema(type=openapi.TYPE_STRING, title="姓名", description="姓名"),
'create_time': openapi.Schema(type=openapi.TYPE_STRING, title="创建时间", description="修改时间"),
'update_time': openapi.Schema(type=openapi.TYPE_STRING, title="修改时间", description="修改时间")

View File

@ -25,6 +25,11 @@
<el-table-column prop="nick_name" label="姓名" />
<el-table-column prop="email" label="邮箱" show-overflow-tooltip />
<el-table-column prop="phone" label="手机号" />
<el-table-column prop="source" label="用户类型">
<template #default="{ row }">
{{ row.source === 'LOCAL' ? '系统用户' : row.source }}
</template>
</el-table-column>
<el-table-column label="状态" width="60">
<template #default="{ row }">
<div @click.stop>