修复脑图无法查看bug

This commit is contained in:
2024-04-24 22:09:53 +08:00
parent 0a0c495af0
commit 645aafcadb
+14 -29
View File
@@ -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
""" % (pk)
# sql = """ # sql = """
# select * from cooperation_mind mind where id=%s and mind.class_id=%s # 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
# """ % (pk, select_id[0]) # 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
# # sql = """ # """ % (pk, select_id, pk, select_id, pk, select_id)
# # select * from cooperation_mind mind where id=%s and mind.class_id=%s mind = CooperationMind.objects.raw(sql)
# # 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 if len(mind) is None:
# # 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 return build_response(code=CODE_FAILED, msg="无权限")
# # """ % (pk, select_id, pk, select_id, pk, select_id) # 序列化
# mind = CooperationMind.objects.raw(sql) serializer = CooperationMindSerializer(mind[0])
# if len(mind) is None: return build_response(data=serializer.data)
# 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 'b9b101e' == page_tag: if 'b9b101e' == page_tag: