# -*- encoding=utf8 -*-

__author__ = "xiaohesheng"

"""
case_tag:api,herp-web,a3院区管理页面,id2263,id2263-3,sit,on
主数据平台:a3院区管理页面 
"""

from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def hospital_area():
    module = "b2_herp3_bs"
    """
     场景:a3院区管理页面
     用例名称：a3院区管理页面
     输入：无
     输出："rtn_msg": {"code": 0, "msg": null,    "data": true}
    """
    #内网登录
    username = commonFuc().get_business_data(module, "username")
    # print('医院名称',username)
    password = commonFuc().get_business_data(module, "password")
    # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
    # 获取token和projectCode
    token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
    # print( token,projectCode,uxid,corpId,info)
    #a3院区管理页面
    url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "5ce279bb138a4261828289ae834ed53a_url")
    # print(url)
    # 获取请求头信息
    headers = commonFuc().get_business_data(module, "json_headers2",
                                            commonFuc().get_business_data(module, "json_contentType"), token,
                                            commonFuc().get_business_data(module, "X-APP-CODE"))

    # 发送请求
    result = commonFuc().http_get(url, headers, params="")
    # print('result', result)
    #断言
    checkDict=commonFuc().get_business_data(module,'checkDict')
    commonFuc().check_result(checkDict,result)
hospital_area()