let user

if (localStorage.getItem('userInfo')) {
    user = JSON.parse(localStorage.getItem('userInfo'))

} else {
    // user = {"user_id":"100","user_name":"tyyxadmin","user_realname":"桐艺云校","user_password":"a2e3d109454dbc90c0aa982b40171325f807f6f4","user_group_id":"1","user_role_id":"69","user_level_id":"1","user_detail_id":null,"user_score":"166","modify_dateline":"1667789381","create_dateline":"1616403054","isdelete":"0","area_id1":"0","area_id2":"0","area_id3":"0","area_id4":"0","sm_id":"0","sm_admin":"0","cm_id":"0","cm_admin":"0","user_phone":"","phone_validation":"0","parent_user_id":null,"user_nickname":"","user_avatar":"https://ossdownload.bozedu.net/template/default/static/img/avatar_student_small.png","subjects":"","user_email":"0","email_validation":null,"email_token":"","email_token_exptime":"1","ischeck":null,"student_no":"","address":"","gender":null,"about":"","qq":"","openid":"","webchatopenid":"1","user_level":null,"user_birthday":"","grade_id":null,"user_grade":null,"personId":"","orgId":"","userIdentity":"0","identityNo":"0","ty_password":"0","ty_userinfo_md5":"","create_user_id":null,"classId":"","user_dept":"","yx_yhly":"1","user_cardno":null,"hy_sm_name":"","hy_sm_id":"","hy_user_id":"","hy_user_type":"","dept_id":"","user_eyear":"0","user_grade_num":"0","user_class_num":"0","last_token":null,"last_login":null,"token":"1a93K0RLGA_aBxBAE_acLVzNTmI_bp8F_bNd956qWbPIzRRPM9V967pWFK71azC0X6ZsrCQzeRMZCSpRlsBseBX1uMKrsJwAldAWPQ","unread_message":0}
    // localStorage.setItem('userInfo', JSON.stringify(user))
}

const refresh = () => {
    user = JSON.parse(localStorage.getItem('userInfo'))
}
export {
    user,
    refresh
}

export default {
    ...user
}

