修改getuserinfo接口,新增用户权限范围内辖区信息
This commit is contained in:
parent
0ad2f6cbb2
commit
07d3882100
|
|
@ -9,12 +9,12 @@ def query_host_by_nodeid(params):
|
||||||
nodeid = check_param(params, 'nodeid')
|
nodeid = check_param(params, 'nodeid')
|
||||||
if not nodeid:
|
if not nodeid:
|
||||||
return json.dumps(make_common_res(1, 'nodeid is missing'))
|
return json.dumps(make_common_res(1, 'nodeid is missing'))
|
||||||
host = g_node2host.get_host(nodeid)
|
# host = g_node2host.get_host(nodeid)
|
||||||
if not host:
|
# if not host:
|
||||||
return json.dumps(make_common_res(2, 'no host for this nodeid'))
|
# return json.dumps(make_common_res(2, 'no host for this nodeid'))
|
||||||
res = make_common_res(0, 'ok')
|
res = make_common_res(0, 'ok')
|
||||||
res['nodeid'] = nodeid
|
res['nodeid'] = nodeid
|
||||||
res['host'] = ScoNodeConfig.host2str(host)
|
# res['host'] = ScoNodeConfig.host2str(host)
|
||||||
return json.dumps(res)
|
return json.dumps(res)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -79,12 +79,17 @@ def do_get_user_info(params, token):
|
||||||
if token is None:
|
if token is None:
|
||||||
res = make_common_res(-1, '鉴权失败,请检查是否已经登录。')
|
res = make_common_res(-1, '鉴权失败,请检查是否已经登录。')
|
||||||
return json.dumps(res)
|
return json.dumps(res)
|
||||||
|
all_area_info = db_user.query_all_area_infos()
|
||||||
user = db_user.query_user(token)
|
user = db_user.query_user(token)
|
||||||
if user is not None:
|
if user is not None:
|
||||||
user_t = {'userno': user['userno'], 'user_name': user['user_name'], 'role': user['role'],
|
user_t = {'userno': user['userno'], 'user_name': user['user_name'], 'role': user['role'],
|
||||||
'department': user['department']}
|
'department': user['department']}
|
||||||
|
user_area_ids = db_user.query_areaid_list(user['userno'])
|
||||||
|
user_area_info = []
|
||||||
|
for area_id in user_area_ids:
|
||||||
|
user_area_info.append(all_area_info[area_id])
|
||||||
res = make_common_res(0, 'ok')
|
res = make_common_res(0, 'ok')
|
||||||
|
res['data'] = user_area_info
|
||||||
res['token'] = user_t
|
res['token'] = user_t
|
||||||
res['desc'] = ''
|
res['desc'] = ''
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue