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