修复脑图无法查看bug
This commit is contained in:
+16
-31
@@ -30,9 +30,6 @@ class JsMindView(LoginRequiredJSONMixin, ListAPIView):
|
|||||||
查询思维导图
|
查询思维导图
|
||||||
"""
|
"""
|
||||||
pk = request.GET.get('id')
|
pk = request.GET.get('id')
|
||||||
print("-----------------------------")
|
|
||||||
print(pk)
|
|
||||||
print("-----------------------------")
|
|
||||||
# 页面源
|
# 页面源
|
||||||
page_tag = request.GET.get('s_p')
|
page_tag = request.GET.get('s_p')
|
||||||
user = request.user
|
user = request.user
|
||||||
@@ -40,34 +37,22 @@ class JsMindView(LoginRequiredJSONMixin, ListAPIView):
|
|||||||
return build_response(code=CODE_FAILED, msg="参数错误")
|
return build_response(code=CODE_FAILED, msg="参数错误")
|
||||||
|
|
||||||
select_id = json.loads(user.select_xiaozu)['xiaozu']
|
select_id = json.loads(user.select_xiaozu)['xiaozu']
|
||||||
print(select_id[0])
|
if pk is not None:
|
||||||
print('list current user: %s' % user)
|
# 查询导图详细 查看用户是否有权限
|
||||||
# if pk is not None:
|
sql = """
|
||||||
# # 查询导图详细 查看用户是否有权限
|
select * from cooperation_mind mind where id=%s
|
||||||
# sql = """
|
""" % (pk)
|
||||||
# select * from cooperation_mind mind where id=%s and mind.class_id =%s
|
# sql = """
|
||||||
#
|
# select * from cooperation_mind mind where id=%s and mind.class_id=%s
|
||||||
# """ % (pk, select_id[0])
|
# union all select m1.* from cooperation_mind m1 join cooperation_mind_share sh on sh.coop_mind_id = m1.id where m1.id=%s and sh.operator_user_id =%s
|
||||||
# # sql = """
|
# union all select m1.* from cooperation_mind m1 join cooperation_mind_star st on st.coop_mind_id = m1.id where m1.id=%s and st.operator_user_id =%s
|
||||||
# # select * from cooperation_mind mind where id=%s and mind.class_id=%s
|
# """ % (pk, select_id, pk, select_id, pk, select_id)
|
||||||
# # union all select m1.* from cooperation_mind m1 join cooperation_mind_share sh on sh.coop_mind_id = m1.id where m1.id=%s and sh.operator_user_id =%s
|
mind = CooperationMind.objects.raw(sql)
|
||||||
# # union all select m1.* from cooperation_mind m1 join cooperation_mind_star st on st.coop_mind_id = m1.id where m1.id=%s and st.operator_user_id =%s
|
if len(mind) is None:
|
||||||
# # """ % (pk, select_id, pk, select_id, pk, select_id)
|
return build_response(code=CODE_FAILED, msg="无权限")
|
||||||
# mind = CooperationMind.objects.raw(sql)
|
# 序列化
|
||||||
# if len(mind) is None:
|
serializer = CooperationMindSerializer(mind[0])
|
||||||
# return build_response(code=CODE_FAILED, msg="无权限")
|
return build_response(data=serializer.data)
|
||||||
# # 序列化
|
|
||||||
# serializer = CooperationMindSerializer(mind[0])
|
|
||||||
# print("--------------------------")
|
|
||||||
# print("--------------------------")
|
|
||||||
# print("--------------------------")
|
|
||||||
# print("--------------------------")
|
|
||||||
# print(serializer)
|
|
||||||
# print("--------------------------")
|
|
||||||
# print("--------------------------")
|
|
||||||
# print("--------------------------")
|
|
||||||
# print("--------------------------")
|
|
||||||
# return build_response(data=serializer.data)
|
|
||||||
|
|
||||||
# 查询列表
|
# 查询列表
|
||||||
if 'b9b101e' == page_tag:
|
if 'b9b101e' == page_tag:
|
||||||
|
|||||||
Reference in New Issue
Block a user