@@ -3,6 +3,7 @@ |
||
3 | 3 |
from django.db import models |
4 | 4 |
from django.utils.translation import ugettext_lazy as _ |
5 | 5 |
from django_models_ext import BaseModelMixin |
6 |
+from shortuuidfield import ShortUUIDField |
|
6 | 7 |
|
7 | 8 |
|
8 | 9 |
class ScreenAdminInfo(BaseModelMixin): |
@@ -24,7 +25,7 @@ class ScreenAdminInfo(BaseModelMixin): |
||
24 | 25 |
(DELETED, u'已删除'), |
25 | 26 |
) |
26 | 27 |
|
27 |
- admin_id = models.CharField(_(u'admin_id'), max_length=32, blank=True, null=True, help_text=u'大屏管理员唯一标识', db_index=True, unique=True) |
|
28 |
+ admin_id = ShortUUIDField(_(u'admin_id'), max_length=32, blank=True, null=True, help_text=u'大屏管理员唯一标识', db_index=True, unique=True) |
|
28 | 29 |
|
29 | 30 |
unionid = models.CharField(_(u'unionid'), max_length=32, blank=True, null=True, help_text=u'微信 Union ID', db_index=True) |
30 | 31 |
openid = models.CharField(_(u'openid'), max_length=32, blank=True, null=True, help_text=u'微信 Open ID', db_index=True) |
@@ -39,7 +39,7 @@ def screen_admin_loginqr(request): |
||
39 | 39 |
|
40 | 40 |
token = shortuuid.uuid() |
41 | 41 |
|
42 |
- return response(200, { |
|
42 |
+ return response(200, data={ |
|
43 | 43 |
'qr': settings.KODO_SCREEN_LOGIN_URL.format(brand_id, token), |
44 | 44 |
'token': token, |
45 | 45 |
}) |
@@ -74,6 +74,6 @@ def screen_admin_loginrst(request): |
||
74 | 74 |
except ScreenAdminInfo.DoesNotExist: |
75 | 75 |
return response(PermissionStatusCode.PERMISSION_DENIED) |
76 | 76 |
|
77 |
- return response(200, { |
|
77 |
+ return response(200, data={ |
|
78 | 78 |
'info': admin.data, |
79 | 79 |
}) |