Commit 832d5bc7 by dong

fix20230104

parent 0b25293c
......@@ -26,15 +26,9 @@ def list_fields():
@api_power.route('/modifyFields', methods=['POST'])
@login_required
def modify_fields():
# token = request.headers["token"]
# user = verify_btoken(token)
# user_role = user.role # 用户角色
# if user_role != 1:
# return jsonify(code=RET.ROLEERR, msg="暂无权限")
req_dict = request.get_json()
_id = req_dict.get('id') # 行业id
name = req_dict.get("newname") # 行业新名字
# req_dict = request.get_json()
_id = request.get('id') # 行业id
name = request.get("newname") # 行业新名字
try:
field = IndustryChain.query.get(_id)
......
......@@ -76,9 +76,9 @@ def find_up_thr(name_query, relation):
@api_atlas.route('/industry/cluster', methods=['GET'])
def get_cluster():
try:
cluster_obj = IndustryChain.query.filter_by(industry_type=0,
status=1).all()
# cluster_obj = Industry.query.all()
# cluster_obj = IndustryChain.query.filter_by(industry_type=0,
# status=1).all()
cluster_obj = Industry.query.all()
data = {
"cluster": [
......@@ -91,7 +91,9 @@ def get_cluster():
} for j in Industry.query.filter_by(fid=i.nid)
]} for i in cluster_obj]
}
return jsonify(code=RET.OK, msg='产业集群名称获取成功!', data=data)
data = [{"id": i.id, 'name': i.industry_name} for i in cluster_obj]
print('发起请求')
return jsonify(code=RET.OK, msg='产业名称获取成功!', data=data)
except Exception as e:
current_app.logger.error(e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment