//index 0开发环境   1测试环境   2正式环境
const index = 2,
  api = {
    login: 'auth/login_by_weixin', //登录
    getMyPrivateMsgCount: 'message/getMyPrivateMsgCount', //加载是否有未读消息
    home: 'home/index', //首页数据
    club: 'organize/selectOrganizeByUserId', // 委办局
    clubDetails: 'organize/detail', //  委办局详情
    guidanceDocList: 'items/guidanceDocList', // 服务大厅 办事指南 
    newsDetail: 'news/read', //新闻详情
    newsList: 'news/list', //新闻列表
    allDept: 'getAllVillagesDept.if',

    // level: 'getAllDeptByLevel.if', //服务大厅部门类别
    // levelDetail: 'getPreServiceByParam.if', //服务大厅事项列表

    // consultancyBm: 'getAllDeptByLevel.if', //互动页查询咨询部门
    matters: 'getServiceListBydeptId.if', //互动页查询部门可办事项
    interactionSave: 'consulting/save', //互动页保存咨询信息  	

    reservationDetail: 'reservation/getInfo.if', //预约详情	
    reservationCancel: 'reservation/cancel.if', //取消预约
    reservationSave: 'reservation/save.if', //在线预约
    reservationServiceList: 'getReservationServiceList.if', //可预约部门列表
    reservationDateStatus: 'reservation/getReservationCount.if', //查询事项某个日期的预约情况
    myCase: 'getPreApasinfoListByUserId.if', //我的办件
    // param: 'getPreServiceByParam.if', //事项办理
    caseDetail: 'getPreApasinfoDetails.if', //办件详情



    setImg: 'material/getList', //选择我的材料，材料列表
    saveDataName: 'material/save', //保存我的材料，设置材料名称
    apasinfo: 'savePreApasinfo.if', //提交在线办理表单


    // Server: 'getClassificationByCode.if', //服务大厅列表
    Level: 'getAllDeptByLevel.if', //服务大厅部门类别
    // LevelDetail: 'getPreServiceByParam.if', //服务大厅事项列表
    // Guide: 'getPreServiceByUnid.if',//查询办事详情
    // MyReservation: 'reservation/getPageList.if',//我的预约
    ReservationDetail: 'reservation/getInfo.if', //预约详情
    ReservationCancel: 'reservation/cancel.if', //取消预约
    sendVerifCode: '/sms//sendVerifCode.if', //发送短信验证码

    // Param: 'getPreServiceByParam.if',//事项办理
    // Code: 'getClassificationByCode.if',//证件类型
    // GetUser: 'user/getUserInfo',//获取用户信息
    // UpdateUser: 'user/updateUserInfo',//更新用户信息
    // UploadImg: 'uploadFile.if',//上传
    // SetImg: 'material/getList',//选择我的材料，材料列表
    // SaveDataName: 'material/save',//保存我的材料，设置材料名称
    Apasinfo: 'savePreApasinfo.if', //提交在线办理表单
    UploadAudio: 'getPreServiceByServiceName.if', //语音文件上传
    HotService: 'getHotServiceList.if', //搜索咨询对象
    // myData: 'material/getList',//我的材料
    // addData: 'material/save',//上传资料
    // deleteData: 'material/delete',//删除材料
    advisoryList: 'consulting/getListPage', //我的咨询
    advisoryDetail: 'consulting/getInfo', //咨询详情


    // new apis

    departments: 'getAllDeptByLevel.if', //部门列表
    server: 'getClassificationByCode.if', //根据code得到相应类型
    handles: 'getPreServiceByParam.if', //服务大厅事项列表
    guide: 'getPreServiceByUnid.if',
    getUser: 'user/getUserInfo', //获取用户信息
    updateUser: 'user/updateUserInfo', //更新用户信息
    uploadImg: 'uploadFile.if', //上传图片
    myMaterial: 'material/getList', //我的材料
    addMaterial: 'material/save', //上传资料
    delMaterial: 'material/delete', //删除材料
    myReservation: 'reservation/getPageList.if', //我的预约

    addCollect: 'collect/save', //添加收藏
    delCollect: 'collect/cancel', //删除收藏
    myCollection: 'collect/getListByUserId', //我的收藏 
    verifSmsCode: 'sms/verifSmsCode.if', //验证手机验证码是否正确
    evaluate: 'evaluate/save.if', //增加评价
    evaluateList: 'evaluate/list.if', //评价列表
    evaluateInfo: 'evaluate/info.if', //评价详情




    // 宿管系统--学生端
    getAccessInfo: 'access/getAccessInfo.if', //发送短信验证码
    sendPhoneCode: 'visitor/sendPhoneCode.if', //访客申请
    userLogin: 'appletLogin/userLogin.if', //登录
    selfInfo: 'access/selfInfo.if', //访客统计
    editorAlumniVisitor: 'visitor/editorAlumniVisitor.if', //访客申请
    getUserInfo: 'userinfo/getUserInfo.if', //查询用户信息
    updateUserHeadImage: 'userinfo/updateUserHeadImage.if',//上传用户和底库图片
    updateimage: 'userinfo/updateImage.if',//修改用户头像
    getYouTuImage: 'userinfo/getYouTuImage.if',//获取学生人脸自助上传图片
    submitPropose:'proposePort/submitPropose.if',//投诉建议
    findProposeList:'proposePort/findProposeList.if',//投诉建议查询列表
    findProposeDetails:'proposePort/findProposeDetails.if',//投诉建议列表明细
    //宿管系统--教师端
    getDeptInfo: 'deptInfo/getDeptInfolevel.if', //获取学院信息
    getRegisterInfo: 'dormManage/registerInfo.if', //获取注册和未注册的用户信息
    getVisitorCheckInfo: 'visitor/visitorInfo.if', //获取审批中和已审批的访客信息
    getDeviceInfo: 'access/selectDevices.if', //获取所有设备信息
    getPassInfo: '/access/getAccess.if', //通行记录
    getStatisticsInfo: '/access/statisticsBy.if', //考勤统计
    getOutAndInInfo: '/access/outAndIn.if', //已出已归记录
    getVisitorInfo: '/visitor/searchInviteVisitor.if', //查询访客详情
    getVisitorCheck: '/visitor/approvalAlumniVisitor.if', //访客信息审批
	getunInByCount: '/access/unInByCount.if', //按天查询未归记录
    getOutAndInInfo: '/access/InAndOut.if', //已出已归记录
    getUnInInfo: '/access/outUnIn.if', //未归记录
    getLateIn: '/access/lateIn.if', //晚归记录
    getInUnOunt: '/access/InUnOunt.if', //未出记录
    getUnOut: '/access/unOut.if', //查询没有进出记录的人员情况
    getSuggestionList: '/proposePort/findProposeList.if', //获取投诉列表
    getSuggestionDetail: '/proposePort/findProposeDetails.if', //获取投诉列表详情
    getSuggestionResponse: '/proposePort/answerPropose.if', //投诉建议回复
    total: '.if', //图片拼接域名
  },
  [oneportal, root] = [
    ["http://192.168.100.234:8080/oneportal/", "https://zhll.dgtis.com/wx/"],
    ["http://192.168.100.254:9082/wx/", "https://zhll.dgtis.com/wx/"],
    ["https://dorm.dgtis.com/oneportal/", "https://dorm.dgtis.com/wx/"]
  ][index]
Object.keys(api).forEach(x => {
  let v = api[x]
  api[x] = `${/\.if$/.test(v) ? oneportal : root}${v}`
  // api[x] = `${root}${v}`
})
module.exports = api