|
@@ -29,6 +29,7 @@ from Service.CommonService import CommonService
|
|
|
from Service.ModelService import ModelService
|
|
|
from Object.RedisObject import RedisObject
|
|
|
import base64
|
|
|
+from Controller.CheckUserData import RandomStr
|
|
|
'''
|
|
|
http://192.168.136.40:8077/uiduser/add?token=local&UID=z123asdfqwerzxcvqw12&NickName=xxoxox&View_Account=user&View_Password=password&ChannelIndex=8&is_ap=1&Type=5&NickName=1234zcxv
|
|
|
http://192.168.136.40:8077/uiduser/query?token=local&page=1&line=10&is_ap=1&NickName=1234zcxv&uid=zxcvasdfqwerzxcvqwer
|
|
@@ -365,7 +366,8 @@ class UidUserView(View):
|
|
|
|
|
|
|
|
|
|
|
|
-# 添加设备字段
|
|
|
+
|
|
|
+# v3添加设备字段
|
|
|
def v3addInterface(request):
|
|
|
request.encoding = 'utf-8'
|
|
|
response = ResponseObject()
|
|
@@ -477,7 +479,6 @@ def v3queryInterface(request):
|
|
|
response.lang = tko.lang
|
|
|
if page <= 0:
|
|
|
return response.json(0)
|
|
|
-
|
|
|
if tko.code == 0:
|
|
|
userID = tko.userID
|
|
|
redisObj = RedisObject(db=8)
|
|
@@ -518,6 +519,7 @@ def v3queryInterface(request):
|
|
|
if dm['endTime'] > nowTime:
|
|
|
p['vod'].append(dm)
|
|
|
p['preview'] = []
|
|
|
+ p['View_Password'] = encrypt_pwd(p['View_Password'])
|
|
|
for up in upqs:
|
|
|
if p['UID'] == up['uid']:
|
|
|
obj = 'uid_preview/{uid}/channel_{channel}.png'.format(uid=up['uid'], channel=up['channel'])
|
|
@@ -538,6 +540,20 @@ def v3queryInterface(request):
|
|
|
else:
|
|
|
return response.json(tko.code)
|
|
|
|
|
|
+# 加密
|
|
|
+def encrypt_pwd(userPwd):
|
|
|
+ for i in range(1, 4):
|
|
|
+ if i == 1:
|
|
|
+ userPwd = RandomStr(3, False)+userPwd+RandomStr(3, False)
|
|
|
+ userPwd = base64.b64encode(str(userPwd).encode("utf-8")).decode('utf8')
|
|
|
+ if i == 2:
|
|
|
+ userPwd = RandomStr(2, False)+str(userPwd)+RandomStr(2, False)
|
|
|
+ userPwd = base64.b64encode(str(userPwd).encode("utf-8")).decode('utf8')
|
|
|
+ if i == 3:
|
|
|
+ userPwd = RandomStr(1, False)+str(userPwd)+RandomStr(1, False)
|
|
|
+ userPwd = base64.b64encode(str(userPwd).encode("utf-8")).decode('utf8')
|
|
|
+ return userPwd
|
|
|
+
|
|
|
|
|
|
|
|
|
|