let user

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

} else {
    // user = { "user_id": "2", "user_name": "demo1", "user_realname": "普通用户", "user_password": "10470c3b4b1fed12c3baac014be15fac67c6e815", "user_group_id": "1", "user_role_id": "57", "user_level_id": "1", "user_detail_id": "0", "user_score": "0", "create_dateline": "1584973789", "modify_dateline": "1361415743", "isdelete": "0", "area_id1": "0", "area_id2": "0", "area_id3": "0", "area_id4": "0", "user_phone": "", "user_cardno": "320581888888888888", "phone_validation": "0", "parent_user_id": "0", "user_nickname": "", "user_avatar": "", "user_email": "huming17@126.com", "email_validation": "0", "email_token": "", "email_token_exptime": "0", "ischeck": "1", "address": "江苏省苏州市", "gender": "1", "about": "", "qq": "", "openid": "", "user_birthday": "0000-00-00", "webchatopenid": "", "user_level": "1", "user_abalance": "0.00", "user_dcash": "0.00", "user_dqsj": "", "user_alipay_account": "huming17@126.com", "token": "d7f1dtotT6_aJKZfKJem9N6lhVXxCEfCLHMaV1Hs9GXTNZzaaJ05ROgpdtZts45o1geHL4ZUfXugt19TVvNOaKRQffYG7sww", "setting": { "sitename": "站点名称", "sitedomain": "http://localhost/", "site_icp": "苏ICP 备88888888号", "sitelogo": "http://tyyx.bozedu.top/logo.png", "siteqrcode": "http://tyyx.bozedu.top/qrcode.jpg", "sitefavicon": "", "site_wxapp_appid": "*", "site_wx_sp_appid": "*", "site_wx_sp_mchid": "*", "user_failedlogin_max": "500", "site_address": "某省某市某县大厦楼层", "site_hotphone": "13866666666", "site_linephone": "0000-99999999", "site_email": "info@name.com", "site_wx_mchid": "", "site_wx_appid": "" }, "user_address": {} }
    // localStorage.setItem('userInfo', JSON.stringify(user))
}

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

export default {
    ...user
}

