const config={
    getUserInfo(){
        let projectId =  localStorage.getItem("projectId")||'';//项目ID
        let customerId =  localStorage.getItem("customerId")||'';//用户id
        let customerhead =  localStorage.getItem("customerhead")||'';//用户头像
        let roleName =  localStorage.getItem("roleName")||'';//名称    
        let phone =  localStorage.getItem("phone")||'';//手机号  
        let registChannel =  localStorage.getItem("registChannel")||'';//渠道  
        let userInfo = {
            projectId: projectId,
            customerId:customerId,
            customerhead:customerhead,
            phone:phone,
            roleName:roleName,
            registChannel:registChannel
        }
      return userInfo
    },
    //问候语转化
    getTime(){
        let time = new Date()
        let house = time.getHours();
        if(house>=4 && house<9){
            return '早上好';
        }else if(house>=9 && house<12){
            return '上午好';
        }else if(house>=12 && house<19){
            return '下午好';
        }else{
            return '晚上好';
        }
    },
    timestampToTime(timestamp) {
        var date = new Date(timestamp);
        var Y = date.getFullYear() + '.';
        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '.';
        var D = (date.getDate() < 10 ? '0'+(date.getDate()) : date.getDate()) + ' ';
        var h = (date.getHours() < 10 ? '0'+(date.getHours()) : date.getHours()) + ':';
        var m = (date.getMinutes() < 10 ? '0'+(date.getMinutes()) : date.getMinutes());
        return Y+M+D+h+m;
    }

}
export default config
