@csrf_exempt
def addChangeHostUserInfo(request):
    '\n    新增主机用户\n    修改主机用户\n    '
    v_hostUserId = request.POST.get('host_user_id')
    v_hostId = request.POST.get('host_id')
    v_hostUser = request.POST.get('host_user')
    v_hostPasswd = request.POST.get('host_passwd')
    v_userDesc = request.POST.get('user_desc')
    print(v_hostUserId, v_hostId, v_hostUser, v_hostPasswd, v_userDesc)
    if ((v_hostUserId == '') or (v_hostUserId is None)):
        try:
            hostObj = host.objects.get(id=v_hostId)
            hostUserObj = hostUser(hostUser=v_hostUser, hostPasswd=v_hostPasswd, userDesc=v_userDesc, host=hostObj)
            hostUserObj.save()
            result = {'status': 1, 'msg': '保存成功!', 'data': ''}
            return HttpResponse(json.dumps(result), content_type='application/json')
        except Exception as e:
            logger.error(str(e))
            result = {'status': 2, 'msg': '保存失败!', 'data': ''}
            return HttpResponse(json.dumps(result), content_type='application/json')
    else:
        try:
            hostUserObj = hostUser.objects.filter(id=v_hostUserId)
            hostUserObj.update(hostUser=v_hostUser, hostPasswd=v_hostPasswd, userDesc=v_userDesc)
            result = {'status': 1, 'msg': '修改成功!', 'data': ''}
            return HttpResponse(json.dumps(result), content_type='application/json')
        except Exception as e:
            logger.error(str(e))
            result = {'status': 2, 'msg': '修改失败!', 'data': ''}
            return HttpResponse(json.dumps(result), content_type='application/json')
新增主机用户
修改主机用户
@csrf_exempt
def addChangeHostUserInfo(request):
    '\n    新增主机用户\n    修改主机用户\n    '
    v_hostUserId = request.POST.get('host_user_id')
    v_hostId = request.POST.get('host_id')
    v_hostUser = request.POST.get('host_user')
    v_hostPasswd = request.POST.get('host_passwd')
    v_userDesc = request.POST.get('user_desc')
    print(v_hostUserId, v_hostId, v_hostUser, v_hostPasswd, v_userDesc)
    if ((v_hostUserId == ) or (v_hostUserId is None)):
        try:
            hostObj = host.objects.get(id=v_hostId)
            hostUserObj = hostUser(hostUser=v_hostUser, hostPasswd=v_hostPasswd, userDesc=v_userDesc, host=hostObj)
            hostUserObj.save()
            result = {'status': 1, 'msg': '保存成功!', 'data': }
            return HttpResponse(json.dumps(result), content_type='application/json')
        except Exception as e:
            logger.error(str(e))
            result = {'status': 2, 'msg': '保存失败!', 'data': }
            return HttpResponse(json.dumps(result), content_type='application/json')
    else:
        try:
            hostUserObj = hostUser.objects.filter(id=v_hostUserId)
            hostUserObj.update(hostUser=v_hostUser, hostPasswd=v_hostPasswd, userDesc=v_userDesc)
            result = {'status': 1, 'msg': '修改成功!', 'data': }
            return HttpResponse(json.dumps(result), content_type='application/json')
        except Exception as e:
            logger.error(str(e))
            result = {'status': 2, 'msg': '修改失败!', 'data': }
            return HttpResponse(json.dumps(result), content_type='application/json')