-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Restful API * 新增配置项API_USER_WHITELIST * 新增OpenAPI swagger菜单 * 单元测试 * 更新依赖 * 更新依赖2 * 更新依赖3 * 增加session鉴权方式
- Loading branch information
Showing
19 changed files
with
1,886 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- coding: UTF-8 -*- | ||
import simplejson as json | ||
from common.utils.permission import superuser_required | ||
from common.utils.extend_json_encoder import ExtendJSONEncoder | ||
from django.http import HttpResponse | ||
from .models import Users | ||
|
||
|
||
@superuser_required | ||
def lists(request): | ||
"""获取用户列表""" | ||
users = Users.objects.order_by('username') | ||
users = users.values("id", "username", "display", "is_superuser", "is_staff", "is_active", "email") | ||
|
||
rows = [row for row in users] | ||
|
||
result = {"status": 0, "msg": "ok", "data": rows} | ||
return HttpResponse(json.dumps(result, cls=ExtendJSONEncoder, bigint_as_string=True), | ||
content_type='application/json') |
Oops, something went wrong.