:art: Compatible with code_ticket which starts with 'http(s)://'

huangqimin 5 年之前
父节点
当前提交
9917f6bdd7
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      api/encrypt_views.py

+ 2 - 0
api/encrypt_views.py

@@ -3,6 +3,7 @@
3 3
 from __future__ import division
4 4
 
5 5
 import random
6
+import re
6 7
 
7 8
 from django.conf import settings
8 9
 from django.db import transaction
@@ -181,6 +182,7 @@ def decrypt2(request):
181 182
     user_id = request.POST.get('user_id', '')
182 183
 
183 184
     if code_ticket and user_id:
185
+        code_ticket = re.sub(r'http://|https://', '', code_ticket)
184 186
         try:
185 187
             user = UserInfo.objects.get(user_id=user_id)
186 188
         except UserInfo.DoesNotExist: